[lld] r296505 - Fix wrong TLS symbol values.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 28 11:06:32 PST 2017
Author: ruiu
Date: Tue Feb 28 13:06:32 2017
New Revision: 296505
URL: http://llvm.org/viewvc/llvm-project?rev=296505&view=rev
Log:
Fix wrong TLS symbol values.
I do not fully understand why we had these values in the tests, but
the new value matches what ld.bfd and ld.gold set, so I guess that
was just a mistake.
Differential Revision: https://reviews.llvm.org/D30441
Modified:
lld/trunk/ELF/SyntheticSections.cpp
lld/trunk/test/ELF/gc-debuginfo-tls.s
lld/trunk/test/ELF/mips-tls-64.s
lld/trunk/test/ELF/mips-tls-hilo.s
lld/trunk/test/ELF/mips-tls.s
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=296505&r1=296504&r2=296505&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Tue Feb 28 13:06:32 2017
@@ -1376,14 +1376,6 @@ template <class ELFT> void SymbolTableSe
if (const OutputSection *OutSec = Body->getOutputSection<ELFT>()) {
ESym->st_shndx = OutSec->SectionIndex;
-
- // This piece of code should go away as it doesn't make sense,
- // but we want to keep it tentatively because some tests for TLS
- // variable depends on this. We should fix the test and remove
- // this code.
- if (Body->isLocal())
- if (auto *DS = dyn_cast<DefinedRegular<ELFT>>(Body))
- ESym->st_value = OutSec->Addr + DS->Section->getOffset(*DS);
} else if (isa<DefinedRegular<ELFT>>(Body)) {
ESym->st_shndx = SHN_ABS;
} else if (isa<DefinedCommon>(Body)) {
Modified: lld/trunk/test/ELF/gc-debuginfo-tls.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-debuginfo-tls.s?rev=296505&r1=296504&r2=296505&view=diff
==============================================================================
--- lld/trunk/test/ELF/gc-debuginfo-tls.s (original)
+++ lld/trunk/test/ELF/gc-debuginfo-tls.s Tue Feb 28 13:06:32 2017
@@ -6,7 +6,7 @@
# NOGC: Symbol {
# NOGC: Name: patatino
-# NOGC-NEXT: Value: 0x1000
+# NOGC-NEXT: Value: 0x0
# NOGC-NEXT: Size: 0
# NOGC-NEXT: Binding: Local
# NOGC-NEXT: Type: TLS
Modified: lld/trunk/test/ELF/mips-tls-64.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-tls-64.s?rev=296505&r1=296504&r2=296505&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-tls-64.s (original)
+++ lld/trunk/test/ELF/mips-tls-64.s Tue Feb 28 13:06:32 2017
@@ -29,7 +29,7 @@
# DIS-NEXT: 30040 00000000 00000000 00000000 00000001
# DIS-NEXT: 30050 ffffffff ffff8004 ffffffff ffff9004
-# DIS: 0000000000040000 l .tdata 00000000 loc
+# DIS: 0000000000000000 l .tdata 00000000 loc
# DIS: 0000000000000004 g .tdata 00000000 bar
# DIS: 0000000000000000 g *UND* 00000000 foo
Modified: lld/trunk/test/ELF/mips-tls-hilo.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-tls-hilo.s?rev=296505&r1=296504&r2=296505&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-tls-hilo.s (original)
+++ lld/trunk/test/ELF/mips-tls-hilo.s Tue Feb 28 13:06:32 2017
@@ -21,7 +21,7 @@
# DIS-NEXT: 2000c: 24 62 90 00 addiu $2, $3, -28672
# %lo(loc0 - .tdata - 0x7000) --^
-# DIS: 00040000 l .tdata 00000000 loc0
+# DIS: 00000000 l .tdata 00000000 loc0
# CHECK: Relocations [
# CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/mips-tls.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-tls.s?rev=296505&r1=296504&r2=296505&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-tls.s (original)
+++ lld/trunk/test/ELF/mips-tls.s Tue Feb 28 13:06:32 2017
@@ -27,7 +27,7 @@
# DIS-NEXT: 30020 00000000 00000001 00000000 00000001
# DIS-NEXT: 30030 ffff8004 ffff9004
-# DIS: 00040000 l .tdata 00000000 loc
+# DIS: 00000000 l .tdata 00000000 loc
# DIS: 00000004 g .tdata 00000000 bar
# DIS: 00000000 g *UND* 00000000 foo
More information about the llvm-commits
mailing list