[lld] r287125 - Don't error if __tls_get_addr is defined.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 16 10:01:41 PST 2016
Author: rafael
Date: Wed Nov 16 12:01:41 2016
New Revision: 287125
URL: http://llvm.org/viewvc/llvm-project?rev=287125&view=rev
Log:
Don't error if __tls_get_addr is defined.
Turns out some systems do define it. Not producing an error in this
case matches gold and bfd.
Added:
lld/trunk/test/ELF/defined-tls_get_addr.s
Modified:
lld/trunk/ELF/SymbolTable.cpp
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=287125&r1=287124&r2=287125&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Wed Nov 16 12:01:41 2016
@@ -137,7 +137,8 @@ DefinedRegular<ELFT> *SymbolTable<ELFT>:
template <class ELFT>
DefinedRegular<ELFT> *SymbolTable<ELFT>::addIgnored(StringRef Name,
uint8_t Visibility) {
- if (!find(Name))
+ SymbolBody *S = find(Name);
+ if (!S || !S->isUndefined())
return nullptr;
return addAbsolute(Name, Visibility);
}
Added: lld/trunk/test/ELF/defined-tls_get_addr.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/defined-tls_get_addr.s?rev=287125&view=auto
==============================================================================
--- lld/trunk/test/ELF/defined-tls_get_addr.s (added)
+++ lld/trunk/test/ELF/defined-tls_get_addr.s Wed Nov 16 12:01:41 2016
@@ -0,0 +1,10 @@
+// RUN: llvm-mc %s -o %t.o -triple x86_64-pc-linux -filetype=obj
+// RUN: ld.lld %t.o -o %t
+
+// Don't error if __tls_get_addr is defined.
+
+.global _start
+.global __tls_get_addr
+_start:
+__tls_get_addr:
+nop
More information about the llvm-commits
mailing list