forked from OSchip/llvm-project
Define __tls_get_addr as a hidden symbol even for ARM or MIPS.
addIgnored defines a given symbol even if there is no existing symbol with the same name. So, even if libc provides __tls_get_addr, we should still be able to call addIgnored. Differential Revision: https://reviews.llvm.org/D32053 llvm-svn: 301290
This commit is contained in:
parent
490397fc08
commit
a2a46a9532
|
@ -858,11 +858,8 @@ template <class ELFT> void Writer<ELFT>::addReservedSymbols() {
|
||||||
// __tls_get_addr is defined by the dynamic linker for dynamic ELFs. For
|
// __tls_get_addr is defined by the dynamic linker for dynamic ELFs. For
|
||||||
// static linking the linker is required to optimize away any references to
|
// static linking the linker is required to optimize away any references to
|
||||||
// __tls_get_addr, so it's not defined anywhere. Create a hidden definition
|
// __tls_get_addr, so it's not defined anywhere. Create a hidden definition
|
||||||
// to avoid the undefined symbol error. As usual special cases are ARM and
|
// to avoid the undefined symbol error.
|
||||||
// MIPS - the libc for these targets defines __tls_get_addr itself because
|
if (!In<ELFT>::DynSymTab)
|
||||||
// there are no TLS optimizations for these targets.
|
|
||||||
if (!In<ELFT>::DynSymTab &&
|
|
||||||
(Config->EMachine != EM_MIPS && Config->EMachine != EM_ARM))
|
|
||||||
Symtab<ELFT>::X->addIgnored("__tls_get_addr");
|
Symtab<ELFT>::X->addIgnored("__tls_get_addr");
|
||||||
|
|
||||||
// If linker script do layout we do not need to create any standart symbols.
|
// If linker script do layout we do not need to create any standart symbols.
|
||||||
|
|
Loading…
Reference in New Issue