[Bug target/58066] GCC mis-compiles access to TLS variable with -fPIC on x86_64
ppluzhnikov at google dot com
gcc-bugzilla@gcc.gnu.org
Tue Aug 6 23:14:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066
--- Comment #3 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
(In reply to Paul Pluzhnikov from comment #2)
> What is the way to turn it on?
Compiling test case with -mtls-dialect=gnu2 does appear to improve the picture:
g++ -fPIC -O2 -S t.cc -mtls-dialect=gnu2
__cxa_get_globals:
leaq _ZL3ccc@TLSDESC(%rip), %rax
call *_ZL3ccc@TLSCALL(%rax)
addq %fs:0, %rax
ret
The indirect call goes to _dl_tlsdesc_dynamic in ld-linux-x86-64.so.2 with
misaligned stack, and the latter re-aligns it.
More information about the Gcc-bugs
mailing list