This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] killing remaining USE___THREAD use
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: OndÅej BÃlka <neleai at seznam dot cz>, Mike Frysinger <vapier at gentoo dot org>, libc-alpha at sourceware dot org
- Date: Tue, 6 May 2014 15:06:27 -0700 (PDT)
- Subject: Re: [RFC] killing remaining USE___THREAD use
- Authentication-results: sourceware.org; auth=none
- References: <4096104 dot BXBWkszvSk at vapier> <20140324224059 dot 737BC74484 at topped-with-meat dot com> <mvmtxamn1i3 dot fsf at hawking dot suse dot de> <20140325165620 dot 8A54374479 at topped-with-meat dot com> <87k3bii2df dot fsf at igel dot home> <20140325180311 dot C17357449A at topped-with-meat dot com> <87bnwuhzr7 dot fsf at igel dot home> <20140329113140 dot GA14128 at domone dot podge> <mvmd2h2hiqg dot fsf at hawking dot suse dot de> <20140424134018 dot GA15060 at domone dot podge> <mvmeh071f0p dot fsf at hawking dot suse dot de>
I'm not sure what you think the mystery is. There was a period when we
thought we'd want to use __thread inside ld.so itself. We later concluded
that RTLD_PRIVATE_ERRNO served the only need for it at least as well and it
simplified things not to need ld.so to have a PT_TLS. I'm not sure whether
USE___THREAD-on state in ld.so was ever really used and tested or not, but
I don't think it matters. Either it was always broken or it bit-rotted.
Either way, it's dead code now and there's no reason not to remove it.
There is no mystery as to the intent of the code.
Removing that code will leave us with the TLS_INIT_TP macro having a second
argument that is never used (always passed 0). That argument is only
consulted on i386 (and AFAIK was only ever used there). We could remove
it, though it doesn't hurt to leave that much smaller piece of dead code
around just to move a little more slowly. (Actually there are two pieces:
in linux/i386/tls.h and in hurd/i386/tls.h.) It's in macros (and an inline
for Hurd) where it should always be optimized away at compile time. The
comment in sysdeps/generic/tls.h that should be setting the API for these
macros inverts the sense of the second argument. That should be updated
either to fix that or to remove the argument if that's what we decide.
Thanks,
Roland