Re: Finding the source code for ___tls_get_addr_internal()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 17, 2013 at 2:11 PM, Saul Tamari <stamari@xxxxxxxxx> wrote:
> On Thu, Jan 17, 2013 at 12:07 AM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
>> If you put code that accesses TLS variables into a shared library, and
>> that code was not compiled with -fpic/-fPIC nor with
>> -ftls-model=global-dynamic, then accessing the TLS variables will read
>> the wrong values.
>
> Is there a way to verify if there are wrongly initialized TLS
> variables in some application or I can only detect such cases when the
> application fails?

You could probably look at the dynamic relocations and see if there
are any TLS relocations in the shared library that are not global
dynamic.

> Can the linker or runtime linker warn about these cases? Or because we
> haven't compiled with -fpic or -ftls-model=global-dynamic, then the
> runtime linker doesn't know there are TLS variables in our binary?

I think the linker (ld) could warn about this case.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux