From 96449907a538b78c402696d94fe47bb3f96d543c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 10 Feb 2016 16:26:31 +0000 Subject: [PATCH] Add support for R_X86_64_DTPOFF64. It is used by clang to produce debug info for tls variables. llvm-svn: 260384 --- lld/ELF/Target.cpp | 3 +++ lld/test/ELF/tls-dynamic.s | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 524c705dd0f5..db381a63c0fd 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -872,6 +872,9 @@ void X86_64TargetInfo::relocateOne(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, case R_X86_64_DTPOFF32: write32le(Loc, SA); break; + case R_X86_64_DTPOFF64: + write64le(Loc, SA); + break; case R_X86_64_GOTPCREL: case R_X86_64_PC32: case R_X86_64_PLT32: diff --git a/lld/test/ELF/tls-dynamic.s b/lld/test/ELF/tls-dynamic.s index b6ae6da61bb2..647ab06dceac 100644 --- a/lld/test/ELF/tls-dynamic.s +++ b/lld/test/ELF/tls-dynamic.s @@ -18,6 +18,9 @@ // Initial Exec Model Code Sequence, II movq c@gottpoff(%rip),%rax movq %fs:(%rax),%rax + movabs $a@dtpoff, %rax + movabs $b@dtpoff, %rax + movabs $c@dtpoff, %rax .global a .hidden a @@ -79,3 +82,6 @@ c: // DIS-NEXT: 103b: {{.+}} leaq 8(%rax), %rcx // DIS-NEXT: 1042: {{.+}} movq 4263(%rip), %rax // DIS-NEXT: 1049: {{.+}} movq %fs:(%rax), %rax +// DIS-NEXT: 104d: {{.+}} movabsq $0, %rax +// DIS-NEXT: 1057: {{.+}} movabsq $4, %rax +// DIS-NEXT: 1061: {{.+}} movabsq $8, %rax