Bug 16728 - gold fails to hide hidden tls symbols
Summary: gold fails to hide hidden tls symbols
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.24
: P2 critical
Target Milestone: 2.25
Assignee: Cary Coutant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-20 04:13 UTC by maillist-gdb
Modified: 2014-08-03 12:46 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maillist-gdb 2014-03-20 04:13:38 UTC
firefox 27.0.1 fails to build with gold.

Error relocating /src/build/firefox/mozilla-release/firefox-build-dir/dist/bin/libxul.so: gTLSThreadID: symbol not found

readelf output:
000001fbc4e0  029300000010 R_X86_64_DTPMOD64 0000000000000000 gTLSThreadID + 0
000001fbc4e8  029300000011 R_X86_64_DTPOFF64 0000000000000000 gTLSThreadID + 0
659: 0000000000000000     4 TLS     LOCAL  HIDDEN    17 gTLSThreadID@@xul27

with ld.bfd, grepping for gTLSThreadID returns nothing.

minimal testcase dso_tls_hidden.cc:
#pragma GCC visibility push(hidden)
__thread int foo;
#pragma GCC visibility pop
int bar() { return foo == 1; }

$ g++ -fPIC -shared dso_tls_hidden.cc -o libfoo.so
$ readelf -a libfoo.so  | grep foo
000000001b80  000900000010 R_X86_64_DTPMOD64 0000000000000000 foo + 0
000000001b88  000900000011 R_X86_64_DTPOFF64 0000000000000000 foo + 0
     9: 0000000000000000     4 TLS     LOCAL  HIDDEN    15 foo
    21: 0000000000000000     4 TLS     LOCAL  HIDDEN    15 foo
  000000: Rev: 1  Flags: BASE   Index: 1  Cnt: 1  Name: libfoo.so

with ld.bfd:
$ g++ -fPIC -shared dso_tls_hidden.cc -o libfoo.so
$ readelf -a libfoo.so  | grep foo
    44: 0000000000000000     4 TLS     LOCAL  DEFAULT   14 foo
Comment 1 maillist-gdb 2014-06-12 17:03:35 UTC
ping.
fixing this bug is crucial to make gold fit for real-world usage; instead of staying a toy.