This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: Fall back to a link test for TLS in target libraries


Daniel Jacobowitz wrote:
> 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
> improvements.

I agree.  Since it doesn't look like anyone thinks the test makes
TLS-detection less accurate, and since it does certainly make it
somewhat more accurate on some targets, please go ahead.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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