This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: What is the purpose of _dl_starting_up and why is it removed for HAVE_INLINED_SYSCALLS?
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Andreas Schwab <schwab at suse dot de>
- Date: Thu, 20 Feb 2014 13:11:03 -0800 (PST)
- Subject: Re: What is the purpose of _dl_starting_up and why is it removed for HAVE_INLINED_SYSCALLS?
- Authentication-results: sourceware.org; auth=none
- References: <5306688D dot 1050008 at redhat dot com>
See elf/dl-writev.h. sysdeps/unix/sysv/linux/dl-writev.h overrides that.
At the time of the cited changes, that file didn't exist and the code was
inlined in _dl_debug_vdprintf (elf/dl-misc.c) where it used _dl_starting_up
if [!HAVE_INLINED_SYSCALLS && RTLD_PRIVATE_ERRNO].
Hurd configurations still use elf/dl-writev.h and do not define
HAVE_INLINED_SYSCALLS, but they also set RTLD_PRIVATE_ERRNO to 0. So for
_dl_writev, we could perhaps drop the use of _dl_starting_up and just have
an #error for the #if RTLD_PRIVATE_ERRNO case. (Then new configurations
that set RTLD_PRIVATE_ERRNO to 1 would be obliged to provide their own
dl-writev.h, as Linux configurations do.)
Essentially HAVE_INLINED_SYSCALLS is being used as a proxy for identifying
Linux configurations. That makes vague sense for the _dl_writev use
because _dl_starting_up is used there only in non-Linux configurations.
Obviously that does not make it a clean way to operate.
The other use of _dl_starting_up is to set __libc_multiple_libcs. That use
handles it being an undefined weak symbol and that's the case for Linux
configurations. The Fedora patch might affect what value
__libc_multiple_libcs gets under different conditions. I'm not at all sure
off hand. Though I recall the basic issue that necessitated the
__libc_multiple_libcs logic, I don't recall the exact details of when or
whether it should be set (i.e. both the value to give it and the chronology
in a process when it should get that value).
Thanks,
Roland