This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: TLS details on Linux for x86 and x64
- From: Andrew Haley <aph at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 2 Dec 2017 17:00:23 +0000
- Subject: Re: TLS details on Linux for x86 and x64
- Authentication-results: sourceware.org; auth=none
- References: <e28175eb-9fb6-c57c-ce4e-13591d19ab72@126.com>
On 02/12/17 14:04, Liu Hao wrote:
>
> 0) What is the magical `@tpoff` suffix supposed to do? The `@ntpoff` and
> `@dtpoff` things are documented in System V ABI but there doesn't seem
> to be anything about `@tpoff`.
> 1) How does LD tell that `b` (a thread-local integer) is different from
> `a` (a static integer)? `a` is apparently offset from RIP, but what
> thing is `b` offset from?
> 2) TLS initializers are placed into specially named sections. The
> sections will have the names like `.tls$XXX` where `$XXX` is used to
> sort these sections and discarded thereafter. How is LD supposed to
> associate the section containing the initializer with the symbol of
> object being initialized, without disordering?
>
> Any help will be appreciated.
Have you read
https://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-x86.txt
?
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671