[PATCH] D38910: [AMDGPU/LLD] Add RELATIVE64 relocation record.

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 13:47:11 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL315936: Add base relative relocation record that can be used for the following caseā€¦ (authored by t-tye).

Changed prior to commit:
  https://reviews.llvm.org/D38910?vs=118987&id=119205#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38910

Files:
  lld/trunk/ELF/Arch/AMDGPU.cpp
  lld/trunk/test/ELF/amdgpu-relocs.s


Index: lld/trunk/test/ELF/amdgpu-relocs.s
===================================================================
--- lld/trunk/test/ELF/amdgpu-relocs.s
+++ lld/trunk/test/ELF/amdgpu-relocs.s
@@ -65,10 +65,23 @@
   .quad temp
   .size ptr, 8
 
+# R_AMDGPU_RELATIVE64:
+  .type temp2, @object
+  .local temp2
+  .size temp2, 4
+
+  .type ptr2, @object
+  .globl ptr2
+  .size ptr2, 8
+  .p2align 3
+ptr2:
+  .quad temp2
+
 # The relocation for local_var{0, 1, 2} and var should be resolved by the
 # linker.
 # CHECK: Relocations [
 # CHECK: .rela.dyn {
+# CHECK-NEXT: R_AMDGPU_RELATIVE64 - 0x0
 # CHECK-NEXT: R_AMDGPU_ABS64 common_var0 0x0
 # CHECK-NEXT: R_AMDGPU_ABS64 common_var1 0x0
 # CHECK-NEXT: R_AMDGPU_ABS64 common_var2 0x0
Index: lld/trunk/ELF/Arch/AMDGPU.cpp
===================================================================
--- lld/trunk/ELF/Arch/AMDGPU.cpp
+++ lld/trunk/ELF/Arch/AMDGPU.cpp
@@ -32,7 +32,7 @@
 } // namespace
 
 AMDGPU::AMDGPU() {
-  RelativeRel = R_AMDGPU_REL64;
+  RelativeRel = R_AMDGPU_RELATIVE64;
   GotRel = R_AMDGPU_ABS64;
   GotEntrySize = 8;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38910.119205.patch
Type: text/x-patch
Size: 1080 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171016/a3d6fd5d/attachment.bin>


More information about the llvm-commits mailing list