summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-05-06 17:21:23 +0000
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-05-06 17:21:23 +0000
commitf51d7e76ae2c56588b162d84da54d5c3f0b66b51 (patch)
tree2073534cee9f9a2b17699246639ba42206a3788e
parent81fa2abc8551d65a1085fd0df196531093e57472 (diff)
downloadllvm-f51d7e76ae2c56588b162d84da54d5c3f0b66b51.tar.gz
llvm-f51d7e76ae2c56588b162d84da54d5c3f0b66b51.tar.bz2
llvm-f51d7e76ae2c56588b162d84da54d5c3f0b66b51.tar.xz
PowerPC: Fix unimplemented relocation on ppc64
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
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp5
-rw-r--r--test/ExecutionEngine/MCJIT/eh.ll2
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index 004f4f2996..d4d84d31d0 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -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;
diff --git a/test/ExecutionEngine/MCJIT/eh.ll b/test/ExecutionEngine/MCJIT/eh.ll
index 8b92cc7905..0c19b1bf2e 100644
--- a/test/ExecutionEngine/MCJIT/eh.ll
+++ b/test/ExecutionEngine/MCJIT/eh.ll
@@ -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(...)