1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

update from main archive 960818

This commit is contained in:
Ulrich Drepper
1996-08-19 01:07:44 +00:00
parent e9d258b798
commit 39778c6c9e
13 changed files with 71 additions and 65 deletions

View File

@ -22,6 +22,11 @@ Cambridge, MA 02139, USA. */
#include <stdlib.h>
#include <errno.h>
extern void _dl_start (void); weak_extern (_dl_start)
extern int __libc_multiple_libcs; /* Defined in init-first.c. */
size_t _dl_global_scope_alloc;
struct link_map *
@ -30,7 +35,9 @@ _dl_open (const char *file, int mode)
struct link_map *new, *l;
ElfW(Addr) init;
struct r_debug *r;
/* To decide whether we are the static libc or not. We must use
this variable since gcc would otherwise optimize the test away. */
void (*dl_start_ptr) (void) = &_dl_start;
/* Load the named object. */
new = _dl_map_object (NULL, file, lt_loaded);
@ -131,5 +138,11 @@ _dl_open (const char *file, int mode)
while (init = _dl_init_next (new))
(*(void (*) (void)) init) ();
if (dl_start_ptr == NULL)
/* We must be the static _dl_open in libc.a because ld.so.1 is not
in scope. A static program that has loaded a dynamic object
now has competition. */
__libc_multiple_libcs = 1;
return new;
}