Allow gold to resolve defined TLS symbols in a PIE link.
authorCary Coutant <ccoutant@google.com>
Thu, 9 Apr 2015 22:47:13 +0000 (15:47 -0700)
committerCary Coutant <ccoutant@google.com>
Thu, 9 Apr 2015 22:47:37 +0000 (15:47 -0700)
commita6a177507c8b677e79b3440e36091cb0270c55b8
treed4c54714d9b8c17c35580033a468015ce2b88273
parent18ece1defb99cf50dc7769444e3394c26329d497
Allow gold to resolve defined TLS symbols in a PIE link.

This patch fixes Symbol::final_value_is_known so that a defined TLS symbol
in a PIE link is treated as having a known final value, thus allowing
GD->LE TLS optimization, eliminating an unnecessary GOT entry and dynamic
relocation.

gold/
* symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
in a PIE link.
* testsuite/Makefile.am (tls_pie_test.sh): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/tls_pie_test.sh: New.
gold/ChangeLog
gold/symtab.cc
gold/testsuite/Makefile.am
gold/testsuite/Makefile.in
gold/testsuite/tls_pie_test.sh [new file with mode: 0755]