[llvm] r181134 - AArch64: implement 64-bit absolute relocation in MCJIT

Tim Northover Tim.Northover at arm.com
Sat May 4 13:14:15 PDT 2013


Author: tnorthover
Date: Sat May  4 15:14:14 2013
New Revision: 181134

URL: http://llvm.org/viewvc/llvm-project?rev=181134&view=rev
Log:
AArch64: implement 64-bit absolute relocation in MCJIT

This is about the simplest relocation, but surprisingly rare in actual
code.

It occurs in (for example) the MCJIT test test-ptr-reloc.ll.

Modified:
    llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp

Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=181134&r1=181133&r2=181134&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Sat May  4 15:14:14 2013
@@ -289,6 +289,11 @@ void RuntimeDyldELF::resolveAArch64Reloc
   default:
     llvm_unreachable("Relocation type not implemented yet!");
     break;
+  case ELF::R_AARCH64_ABS64: {
+    uint64_t *TargetPtr = reinterpret_cast<uint64_t*>(Section.Address + Offset);
+    *TargetPtr = Value + Addend;
+    break;
+  }
   case ELF::R_AARCH64_PREL32: { // test-shift.ll (.eh_frame)
     uint64_t Result = Value + Addend - FinalAddress;
     assert(static_cast<int64_t>(Result) >= INT32_MIN && 





More information about the llvm-commits mailing list