[lld] r292513 - Also define 'end' if it is present in a .so.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 19 11:51:02 PST 2017
Author: rafael
Date: Thu Jan 19 13:51:02 2017
New Revision: 292513
URL: http://llvm.org/viewvc/llvm-project?rev=292513&view=rev
Log:
Also define 'end' if it is present in a .so.
I don't know of anything using it, but we should handle it like _end.
Modified:
lld/trunk/ELF/Writer.cpp
lld/trunk/test/ELF/Inputs/resolution-end.s
lld/trunk/test/ELF/resolution-end.s
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=292513&r1=292512&r2=292513&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Jan 19 13:51:02 2017
@@ -771,7 +771,7 @@ template <class ELFT> void Writer<ELFT>:
assert(S.startswith("_"));
S = S.substr(1);
if (SymbolBody *B = Symtab<ELFT>::X->find(S))
- if (B->isUndefined())
+ if (!B->isInCurrentDSO())
Sym2 = Symtab<ELFT>::X->addAbsolute(S, STV_DEFAULT);
};
Modified: lld/trunk/test/ELF/Inputs/resolution-end.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/resolution-end.s?rev=292513&r1=292512&r2=292513&view=diff
==============================================================================
--- lld/trunk/test/ELF/Inputs/resolution-end.s (original)
+++ lld/trunk/test/ELF/Inputs/resolution-end.s Thu Jan 19 13:51:02 2017
@@ -1,2 +1,3 @@
.data
.quad _end
+ .quad end
Modified: lld/trunk/test/ELF/resolution-end.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/resolution-end.s?rev=292513&r1=292512&r2=292513&view=diff
==============================================================================
--- lld/trunk/test/ELF/resolution-end.s (original)
+++ lld/trunk/test/ELF/resolution-end.s Thu Jan 19 13:51:02 2017
@@ -21,19 +21,18 @@
# CHECK-NEXT: AddressAlignment:
# CHECK-NEXT: EntrySize:
# CHECK-NEXT: SectionData (
-# CHECK-NEXT: 0000: 80202000 00000000
+# CHECK-NEXT: 0000: 80202000 00000000 80202000 00000000
# CHECK-NEXT: )
# CHECK: Symbol {
# CHECK: Name: _end
# CHECK-NEXT: Value: 0x202080
-# CHECK-NEXT: Size:
-# CHECK-NEXT: Binding: Global
-# CHECK-NEXT: Type:
-# CHECK-NEXT: Other:
-# CHECK-NEXT: Section:
-# CHECK-NEXT: }
+
+# CHECK: Symbol {
+# CHECK: Name: end
+# CHECK-NEXT: Value: 0x202080
.global _start
_start:
.quad _end
+.quad end
More information about the llvm-commits
mailing list