[lld] r334444 - AMDGPU/LLD: Handle R_AMDGPU_REL64 relocation
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 11 14:42:53 PDT 2018
Author: kzhuravl
Date: Mon Jun 11 14:42:53 2018
New Revision: 334444
URL: http://llvm.org/viewvc/llvm-project?rev=334444&view=rev
Log:
AMDGPU/LLD: Handle R_AMDGPU_REL64 relocation
Requires r334443 from llvm
Differential Revision: https://reviews.llvm.org/D47734
Modified:
lld/trunk/ELF/Arch/AMDGPU.cpp
lld/trunk/test/ELF/amdgpu-relocs.s
Modified: lld/trunk/ELF/Arch/AMDGPU.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/AMDGPU.cpp?rev=334444&r1=334443&r2=334444&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/AMDGPU.cpp (original)
+++ lld/trunk/ELF/Arch/AMDGPU.cpp Mon Jun 11 14:42:53 2018
@@ -66,6 +66,7 @@ void AMDGPU::relocateOne(uint8_t *Loc, R
write32le(Loc, Val);
break;
case R_AMDGPU_ABS64:
+ case R_AMDGPU_REL64:
write64le(Loc, Val);
break;
case R_AMDGPU_GOTPCREL32_HI:
@@ -86,6 +87,7 @@ RelExpr AMDGPU::getRelExpr(RelType Type,
case R_AMDGPU_REL32:
case R_AMDGPU_REL32_LO:
case R_AMDGPU_REL32_HI:
+ case R_AMDGPU_REL64:
return R_PC;
case R_AMDGPU_GOTPCREL:
case R_AMDGPU_GOTPCREL32_LO:
Modified: lld/trunk/test/ELF/amdgpu-relocs.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/amdgpu-relocs.s?rev=334444&r1=334443&r2=334444&view=diff
==============================================================================
--- lld/trunk/test/ELF/amdgpu-relocs.s (original)
+++ lld/trunk/test/ELF/amdgpu-relocs.s Mon Jun 11 14:42:53 2018
@@ -77,6 +77,15 @@ ptr:
ptr2:
.quad temp2
+# R_AMDGPU_REL64:
+.type foo, @object
+.rodata
+ .globl foo
+ .p2align 3
+foo:
+ .quad temp2 at rel64
+ .size foo, 8
+
# The relocation for local_var{0, 1, 2} and var should be resolved by the
# linker.
# CHECK: Relocations [
@@ -101,6 +110,9 @@ ptr2:
# CHECK-NEXT: }
# CHECK-NEXT: ]
+# OBJDUMP: Contents of section .rodata:
+# OBJDUMP: 28fbffff ffffffff
+
# OBJDUMP: Contents of section nonalloc:
# OBJDUMP-NEXT: 0000 00000000 04480000 00000000 08440000
# OBJDUMP-NEXT: 00000000 0c400000
More information about the llvm-commits
mailing list