[lld] r252684 - [elf2][x86-64] Add support for DTPOFF32
Michael J. Spencer via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 17:27:59 PST 2015
Author: mspencer
Date: Tue Nov 10 19:27:58 2015
New Revision: 252684
URL: http://llvm.org/viewvc/llvm-project?rev=252684&view=rev
Log:
[elf2][x86-64] Add support for DTPOFF32
Modified:
lld/trunk/ELF/Target.cpp
lld/trunk/test/elf2/tls-dynamic.s
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=252684&r1=252683&r2=252684&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Tue Nov 10 19:27:58 2015
@@ -322,6 +322,7 @@ bool X86_64TargetInfo::isRelRelative(uin
case R_X86_64_PC16:
case R_X86_64_PC8:
case R_X86_64_PLT32:
+ case R_X86_64_DTPOFF32:
return true;
}
}
@@ -346,6 +347,9 @@ void X86_64TargetInfo::relocateOne(uint8
error("R_X86_64_32S out of range");
write32le(Loc, SA);
break;
+ case R_X86_64_DTPOFF32:
+ write32le(Loc, SA);
+ break;
case R_X86_64_TPOFF32: {
uint64_t Val = SA - Out<ELF64LE>::TlsPhdr->p_memsz;
if (!isInt<32>(Val))
Modified: lld/trunk/test/elf2/tls-dynamic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/tls-dynamic.s?rev=252684&r1=252683&r2=252684&view=diff
==============================================================================
--- lld/trunk/test/elf2/tls-dynamic.s (original)
+++ lld/trunk/test/elf2/tls-dynamic.s Tue Nov 10 19:27:58 2015
@@ -8,14 +8,18 @@
callq __tls_get_addr at PLT
leaq b at tlsld(%rip), %rdi
callq __tls_get_addr at PLT
+ leaq a at dtpoff(%rax), %rcx
+ leaq b at dtpoff(%rax), %rcx
.global a
+ .hidden a
.section .tbss,"awT", at nobits
.align 4
a:
.long 0
.global b
+ .hidden b
.section .tbss,"awT", at nobits
.align 4
b:
@@ -40,9 +44,13 @@ b:
// CHECK-NEXT: }
// 4297 = (0x20D0 + -4) - (0x1000 + 3) // PC relative offset to got entry.
+// 4285 = (0x20D0 + -4) - (0x100c + 3) // PC relative offset to got entry.
// DIS: Disassembly of section .text:
// DIS-NEXT: .text:
// DIS-NEXT: 1000: {{.+}} leaq 4297(%rip), %rdi
// DIS-NEXT: 1007: {{.+}} callq
// DIS-NEXT: 100c: {{.+}} leaq 4285(%rip), %rdi
+// DIS-NEXT: 1013: {{.+}} callq
+// DIS-NEXT: 1018: {{.+}} leaq (%rax), %rcx
+// DIS-NEXT: 101f: {{.+}} leaq 4(%rax), %rcx
More information about the llvm-commits
mailing list