mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
* elf/dl-misc.c: Include <sysdep.h>.
(_dl_debug_vdprintf): Only take dl_load_lock if not _dl_starting_up. * sysdeps/generic/ldsodefs.h (_dl_starting_up): Declare it here. * sysdeps/unix/sysv/linux/init-first.c: Not here. * sysdeps/powerpc/elf/libc-start.c: Or here. * sysdeps/unix/sysv/aix/libc-start.c: Or here. * sysdeps/unix/sysv/aix/start-libc.c: Or here. * sysdeps/unix/sysv/aix/init-first.c: Or here. * sysdeps/generic/libc-start.c: Or here. * sysdeps/unix/sysv/linux/init-first.c (init): Protect _dl_starting_up access with [! SHARED]. * sysdeps/unix/sysv/aix/init-first.c (init): Likewise.
This commit is contained in:
@ -35,9 +35,6 @@
|
||||
/* The function is called from assembly stubs the compiler can't see. */
|
||||
static void init (int, char **, char **) __attribute__ ((unused));
|
||||
|
||||
extern int _dl_starting_up;
|
||||
weak_extern (_dl_starting_up)
|
||||
|
||||
/* Set nonzero if we have to be prepared for more then one libc being
|
||||
used in the process. Safe assumption if initializer never runs. */
|
||||
int __libc_multiple_libcs attribute_hidden = 1;
|
||||
@ -54,12 +51,15 @@ init (int argc, char **argv, char **envp)
|
||||
#ifdef USE_NONOPTION_FLAGS
|
||||
extern void __getopt_clean_environment (char **);
|
||||
#endif
|
||||
|
||||
#ifndef SHARED
|
||||
/* The next variable is only here to work around a bug in gcc <= 2.7.2.2.
|
||||
If the address would be taken inside the expression the optimizer
|
||||
would try to be too smart and throws it away. Grrr. */
|
||||
int *dummy_addr = &_dl_starting_up;
|
||||
|
||||
__libc_multiple_libcs = dummy_addr && !_dl_starting_up;
|
||||
#endif
|
||||
|
||||
/* Make sure we don't initialize twice. */
|
||||
if (!__libc_multiple_libcs)
|
||||
|
Reference in New Issue
Block a user