This is the mail archive of the
mailing list for the GCC project.
Re: Fall back to a link test for TLS in target libraries
On Wed, Nov 08, 2006 at 04:28:25PM -0500, Jakub Jelinek wrote:
> This isn't sufficient, I'm afraid you need to link a shared library
> rather than an executable. Because, at least for most targets __thread
> uses in the executable will be local-exec (no matter what you declared
> them as because of linker TLS optimizations), which doesn't need any
> function calls. If you link a shared library and make sure it doesn't have
> undefined symbols, then you should be safe. An extra complication is that
> older glibcs didn't have ld.so in libc.so linker script and __tls_get_addr
> is in glibc exported from ld.so.
This test gets run on plenty of targets that don't even _have_ shared
libraries. I'm trying to make a modest improvement in it, not a
complete overhaul - so while I agree with all of this, I think that
if the patch is appropriate, it's appropriate even without these
Honestly, I'm not going to work too hard on it. Eventually all the
targets I'm interested in that can support TLS at compile time will
also support it at runtime. It just may be a few years.