PowerPC: Fix unimplemented relocation on ppc64
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Mon, 6 May 2013 17:21:23 +0000 (17:21 +0000)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Mon, 6 May 2013 17:21:23 +0000 (17:21 +0000)
This patch handles the R_PPC64_REL64 relocation type for powerpc64
for mcjit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181220 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
test/ExecutionEngine/MCJIT/eh.ll

index 004f4f299676a9c27478377cc3f2037013efab32..d4d84d31d06e8d8d97e11e28e36c00723952f71f 100644 (file)
@@ -628,6 +628,11 @@ void RuntimeDyldELF::resolvePPC64Relocation(const SectionEntry &Section,
       llvm_unreachable("Relocation R_PPC64_REL32 overflow");
     writeInt32BE(LocalAddress, delta);
   } break;
+  case ELF::R_PPC64_REL64: {
+    uint64_t FinalAddress = (Section.LoadAddress + Offset);
+    uint64_t Delta = Value - FinalAddress + Addend;
+    writeInt64BE(LocalAddress, Delta);
+  } break;
   case ELF::R_PPC64_ADDR64 :
     writeInt64BE(LocalAddress, Value + Addend);
     break;
index 8b92cc79053dba60361b0cd4f4a769bbea458f74..0c19b1bf2e5a3eab365bf68004b46f6d2dffeeb3 100644 (file)
@@ -1,5 +1,5 @@
 ; RUN: %lli_mcjit %s
-; XFAIL: powerpc64, arm, cygwin
+; XFAIL: arm, cygwin
 declare i8* @__cxa_allocate_exception(i64)
 declare void @__cxa_throw(i8*, i8*, i8*)
 declare i32 @__gxx_personality_v0(...)