Re: TLS details on Linux for x86 and x64

2017-12-03 Thread Andrew Haley
On 03/12/17 10:50, Jakub Jelinek wrote: > On Sat, Dec 02, 2017 at 05:00:23PM +, 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 >>

Re: TLS details on Linux for x86 and x64

2017-12-03 Thread Liu Hao
On 2017/12/3 18:50, Jakub Jelinek wrote: > Well, for GNU TLS (rather than GNU2) you want to read > https://www.akkadia.org/drepper/tls.pdf > > Jakub > Thank you too. I am thinking about migrating the technique used by GCC on Linux to Windows, minimizing modification by our side, since it s

Re: TLS details on Linux for x86 and x64

2017-12-03 Thread Jakub Jelinek
On Sat, Dec 02, 2017 at 05:00:23PM +, 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) Ho

Re: TLS details on Linux for x86 and x64

2017-12-03 Thread Liu Hao
On 2017/12/3 1:00, Andrew Haley wrote: > Have you read > > https://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-x86.txt > > ? > No. Well, will do. Thanks for the information. -- Best regards, LH_Mouse

Re: TLS details on Linux for x86 and x64

2017-12-02 Thread Andrew Haley
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` (

TLS details on Linux for x86 and x64

2017-12-02 Thread Liu Hao
Dear x86 and x64 developers, I and JonY are fumbling for implementation of native TLS support for x86 and x64 on Windows. Similarly to that on Linux, the address of a thread local object on Windows is calculated via indirection from the FS or GS segment register, but requires more than one steps.