Bug#874074: ld.so: TLS relocations against local symbols don't work on powerpc, sparc and sparc64
Tags: upstream patch
Usertags: sparc sparc64
X-Debbugs-Cc: email@example.com, firstname.lastname@example.org
On the above architectures, TLS relocations against local symbols do not
work properly, crashing with SIGBUS or SIGSEGV on accessing the variable
in question. This is only a problem when using gold, as bfd will
optimise the relocations (since it knows the symbol cannot be pre-empted
by one in another object) to not refer to a symbol at all. I have
written a test script, available at .
The above patch has been tested on powerpc and sparc64 using my test
script, as well as on sparc64 using my local experimental GHC with
native code generation support, where the problem was first seen.