https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881

--- Comment #27 from Julian Waters <tanksherman27 at gmail dot com> ---
X(In reply to LIU Hao from comment #26)
> Comment on attachment 59290 [details]
> Newer patch for TLS support, incomplete
> 
> > +  "mov{l}\t{_tls_index(%%rip), %k0|%k0, DWORD PTR 
> > [rip+_tls_index]}\;mov{q}\t{%%gs:88, %1|%1, QWORD PTR 
> > gs:[88]}\;mov{q}\t{(%1,%0,8), %0|%0, QWORD PTR [%1+%0*8]}"
> 
> For i686 this would be (untested):
> 
> ```
> "mov{l}\t{_tls_index, %k0|%k0, DWORD PTR [_tls_index]}\;mov{l}\t{%%fs:44,
> %1|%1, DWORD PTR fs:[44]}\;mov{l}\t{(%1,%0,4), %0|%0, DWORD PTR [%1+%0*4]}"
> ```
> 
> i.e. pointer size is 4 (instead of 8), TLS segment is FS (instead of GS),
> and addresses of global symbols are absolute (instead of being RIP-relative).

I think I remember clang using __tls_index instead of _tls_index for 32 bit as
well, but that's the only difference I remember. On another note, Cygwin
doesn't support TLS natively, right? Eric modified the stopgap patch above and
he put some definitions in cygming.h, since he expects it to support Cygwin as
well, but I vaguely remember you saying something about Cygwin not having the
support for this

Reply via email to