This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__tls_get_addr in localplt.data


In https://sourceware.org/ml/libc-alpha/2014-11/msg00123.html,
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
http://www.ezchip.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]