[PATCH] D28122: RuntimeDyldELF: implement R_AARCH64_PREL64 reloc

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 09:35:19 PST 2016


evgeny777 updated this revision to Diff 82606.
evgeny777 added a comment.

Ah, got it. Let's stick to LE then


https://reviews.llvm.org/D28122

Files:
  lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
  test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s


Index: test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s
===================================================================
--- test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s
+++ test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s
@@ -27,13 +27,15 @@
         .p2align        3
 k:
         .xword  f
-        .size   k, 8
+        .xword  f - .
+        .size   k, 16
 
 # rtdyld-check: *{4}(g) = 0xd2e02460
 # rtdyld-check: *{4}(g + 4) = 0xf2c8ace0
 # rtdyld-check: *{4}(g + 8) = 0xf2b13560
 # rtdyld-check: *{4}(g + 12) = 0xf299bde0
 # rtdyld-check: *{8}k = f
+# rtdyld-check: *{8}(k + 8) = f - (k + 8)
 
 ## f & 0xFFF = 0xdef (bits 11:0 of f)
 ## 0xdef << 10 = 0x37bc00
Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
===================================================================
--- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -374,6 +374,9 @@
     write(isBE, TargetPtr, static_cast<uint32_t>(Result & 0xffffffffU));
     break;
   }
+  case ELF::R_AARCH64_PREL64:
+    write64le(TargetPtr, Value + Addend - FinalAddress);
+    break;
   case ELF::R_AARCH64_CALL26: // fallthrough
   case ELF::R_AARCH64_JUMP26: {
     // Operation: S+A-P. Set Call or B immediate value to bits fff_fffc of the


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28122.82606.patch
Type: text/x-patch
Size: 1328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161228/ff93329c/attachment.bin>


More information about the llvm-commits mailing list