This is the mail archive of the gcc@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: TLS details on Linux for x86 and x64


On 03/12/17 10:50, Jakub Jelinek wrote:
> On Sat, Dec 02, 2017 at 05:00:23PM +0000, Andrew Haley wrote:
>> 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
>>
>> ?
> 
> Well, for GNU TLS (rather than GNU2) you want to read
> https://www.akkadia.org/drepper/tls.pdf

Ah, thanks.  I thought that it was much the same.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


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