[lld] r301207 - [ELF] Account for R_386_TLS_LDO_32 addend
Shoaib Meenai via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 24 11:02:12 PDT 2017
Author: smeenai
Date: Mon Apr 24 13:02:11 2017
New Revision: 301207
URL: http://llvm.org/viewvc/llvm-project?rev=301207&view=rev
Log:
[ELF] Account for R_386_TLS_LDO_32 addend
This relocation type has an implicit addend. Account for it when
processing the relocation. Add an offset to an existing test to ensure
it gets processed correctly.
Fixes PR32634.
Differential Revision: https://reviews.llvm.org/D32336
Modified:
lld/trunk/ELF/Target.cpp
lld/trunk/test/ELF/tls-dynamic-i686.s
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=301207&r1=301206&r2=301207&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Mon Apr 24 13:02:11 2017
@@ -532,6 +532,7 @@ int64_t X86TargetInfo::getImplicitAddend
case R_386_GOTPC:
case R_386_PC32:
case R_386_PLT32:
+ case R_386_TLS_LDO_32:
case R_386_TLS_LE:
return SignExtend64<32>(read32le(Buf));
}
Modified: lld/trunk/test/ELF/tls-dynamic-i686.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-dynamic-i686.s?rev=301207&r1=301206&r2=301207&view=diff
==============================================================================
--- lld/trunk/test/ELF/tls-dynamic-i686.s (original)
+++ lld/trunk/test/ELF/tls-dynamic-i686.s Mon Apr 24 13:02:11 2017
@@ -25,7 +25,7 @@ tls1:
.align 4
tls2:
.long 0
- .size tls2, 4
+ .size tls2, 8
.section .text
.globl _start
@@ -42,7 +42,7 @@ leal tls2 at dtpoff(%eax),%edx
leal tls2 at tlsldm(%ebx),%eax
call __tls_get_addr at plt
-leal tls2 at dtpoff(%eax),%edx
+leal tls2 at dtpoff+4(%eax),%edx
movl %gs:0,%eax
addl tls0 at gotntpoff(%ebx),%eax
@@ -91,7 +91,7 @@ addl tls1 at gotntpoff(%ebx),%eax
// DIS-NEXT: 1023: 8d 90 08 00 00 00 leal 8(%eax), %edx
// DIS-NEXT: 1029: 8d 83 f0 ff ff ff leal -16(%ebx), %eax
// DIS-NEXT: 102f: e8 3c 00 00 00 calll 60
-// DIS-NEXT: 1034: 8d 90 08 00 00 00 leal 8(%eax), %edx
+// DIS-NEXT: 1034: 8d 90 0c 00 00 00 leal 12(%eax), %edx
// Initial exec model:
// DIS-NEXT: 103a: 65 a1 00 00 00 00 movl %gs:0, %eax
// DIS-NEXT: 1040: 03 83 f8 ff ff ff addl -8(%ebx), %eax
More information about the llvm-commits
mailing list