This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
What is the purpose of _dl_starting_up and why is it removed for HAVE_INLINED_SYSCALLS?
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>, Andreas Schwab <schwab at suse dot de>
- Date: Thu, 20 Feb 2014 15:41:49 -0500
- Subject: What is the purpose of _dl_starting_up and why is it removed for HAVE_INLINED_SYSCALLS?
- Authentication-results: sourceware.org; auth=none
Andreas,
I was hoping you might be able to shed some light on some
code that I'm looking at in glibc.
We have code in the dynamic loader that sets _dl_starting_up
to 1 during rtld startup and then to 0 when rtld is done
starting up.
Code in libc can check _dl_starting_up to change some of
the startup actions.
Presently in glibc all of this code is conditional on
!HAVE_INLINED_SYSCALLS, which means that on Linux we never
use this code since HAVE_INLINED_SYSCALLS is always 1 for
Linux.
In Fedora I have a patch of yours that removes the
!HAVE_INLINED_SYSCALLS checks and makes the use of
_dl_starting_up unconditional.
The question I have is: What does HAVE_INLINED_SYSCALLS have
to do with the purpose of _dl_starting_up?
It seems to me like the two are unrelated.
Ulrich's ChangeLog comment was:
commit ce6e047fbb353e1d2faf15ab104a19db609b622b
Author: Ulrich Drepper <drepper@redhat.com>
Date: Tue Jul 6 04:26:42 2004 +0000
Update.
2004-07-05 Ulrich Drepper <drepper@redhat.com>
* elf/dl-init.c: Don't define and use _dl_starting_up if
HAVE_INLINED_SYSCALLS is defined and the variable is not used.
* elf/dl-support.c: Likewise.
* elf/rtld.c: Likewise.
* elf/dl-misc.c (_dl_debug_vdprintf): Use writev syscall directly
if HAVE_INLINED_SYSCALLS is defined.
* sysdeps/powerpc/powerpc64/dl-machine.h: Don't rest _dl_starting_up
here.
* sysdeps/powerpc/powerpc32/dl-start.S: Likewise.
* sysdeps/unix/sysv/linux/configure.in: Define HAVE_INLINED_SYSCALLS.
* config.h.in: Add entry for HAVE_INLINED_SYSCALLS.
How are _dl_starting_up and HAVE_INLINED_SYSCALLS related?
In libc _dl_starting_up is used to set __libc_multiple_libc's
and that makes sense, if we're starting up then we're the only
libc, otherwise maybe not.
It looks to me like your patch to remove the conditionals
is correct, but I can't rationalize this with Ulrich's commit.
Comments?
Cheers,
Carlos.