This is the mail archive of the
mailing list for the glibc project.
__tls_get_addr in localplt.data
- From: Chris Metcalf <cmetcalf at ezchip dot com>
- To: GLIBC Devel <libc-alpha at sourceware dot org>, Carlos O'Donell <carlos at redhat dot com>
- Date: Fri, 19 Dec 2014 20:05:50 -0500
- Subject: __tls_get_addr in localplt.data
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp dot mailfrom=cmetcalf at ezchip dot com;
Carlos added support for checking ld.so for appropriate PLT use.
Running on tilegx just now, it fails, complaining that there is a
missing required PLT reference to __tls_get_addr in ld.so.
However, it's not at all clear to me that this is in fact a bug. Looking at
libc.so for x86, for example, it seems that the only reason there is a PLT
reference is because it is called via an explicit @PLT reference from
_dl_tlsdesc_dynamic in sysdeps/x86_64/dl-tlsdesc.S.
With tilegx we don't have any calls to __tls_get_addr from within
ld.so itself, so there's no PLT created, so the test fails.
It seems that Ulrich wrote the original x86 version of _dl_tlsdesc_dynamic
with the @PLT reference, but it's certainly not clear to me why; I
think this code is used only in ld.so, and I can't see a good reason
why you'd want to allow an override from another shared library for
__tls_get_addr. So there are multiple mysteries here.
I can fix this by creating a local copy of localplt.data for tile,
of course, but I wonder why it's not "ld.so: __tls_get_addr ?"
in the generic localplt.data, i.e. marked as an optional symbol.
Or, more deeply, why the PLT references are needed on any platform
in the first place.
Any guidance for an appropriate change would be appreciated.
Chris Metcalf, EZChip Semiconductor