[Sparc] Include __tls_get_addr in symbol table for TLS calls to it
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 21 Feb 2018 15:25:26 +0000 (15:25 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 21 Feb 2018 15:25:26 +0000 (15:25 +0000)
commite0af7c390d387036310deac9b5a8f6053f2c88e6
treeecdcdc6b7fc57dc5cb8b29582a26d65ce6a89a31
parent10ad93c6bfb2fe496a4c035810c67a3eaf3f12a3
[Sparc] Include __tls_get_addr in symbol table for TLS calls to it

Global Dynamic and Local Dynamic call relocations only implicitly
reference __tls_get_addr; there is no connection in the ELF file between
the relocations and the symbol other than the specification for the
relocations' semantics. However, it still needs to be in the symbol
table despite the lack of explicit references to the symbol table entry,
since it needs to be bound at link time for these relocations, otherwise
any objects will fail to link.

For details, see https://sourceware.org/bugzilla/show_bug.cgi?id=22832.

Path by: James Clarke (jrtc27)

Differential revision: https://reviews.llvm.org/D43271

llvm-svn: 325688
llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp
llvm/test/CodeGen/SPARC/tls.ll