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 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

	Jakub


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