[PATCH] D28122: RuntimeDyldELF: implement R_AARCH64_PREL64 reloc

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 08:15:59 PST 2016


evgeny777 removed rL LLVM as the repository for this revision.
evgeny777 updated this revision to Diff 82594.
evgeny777 added a comment.

Here is a patch with functional changes only. I'll post NFC changes when this one lands.


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,11 @@
     write(isBE, TargetPtr, static_cast<uint32_t>(Result & 0xffffffffU));
     break;
   }
+  case ELF::R_AARCH64_PREL64: {
+    uint64_t Result = Value + Addend - FinalAddress;
+    write(isBE, TargetPtr, Result);
+    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.82594.patch
Type: text/x-patch
Size: 1369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161228/87d67847/attachment.bin>


More information about the llvm-commits mailing list