summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-07-30 03:35:05 +0000
committerLang Hames <lhames@gmail.com>2014-07-30 03:35:05 +0000
commit1316365e2cee88687b503d3818987a5fed147463 (patch)
tree21fd3153e620b2a893bc138cc21133249f50ff80 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
parent005214ce50dd62936cf5834d46a2dd257a7f0b3d (diff)
downloadbcm5719-llvm-1316365e2cee88687b503d3818987a5fed147463.tar.gz
bcm5719-llvm-1316365e2cee88687b503d3818987a5fed147463.zip
[MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO.
We now (1) correctly decode the branch immediate, (2) modify the immediate to corretly treat it as PC-rel, and (3) properly populate the stub entry. Previously we had been doing each of these wrong. <rdar://problem/17750739> llvm-svn: 214285
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index 920b999fa08..bae2471054d 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -79,7 +79,8 @@ RelocationValueRef RuntimeDyldMachO::getRelocationValueRef(
void RuntimeDyldMachO::makeValueAddendPCRel(RelocationValueRef &Value,
ObjectImage &ObjImg,
- const relocation_iterator &RI) {
+ const relocation_iterator &RI,
+ unsigned OffsetToNextPC) {
const MachOObjectFile &Obj =
static_cast<const MachOObjectFile &>(*ObjImg.getObjectFile());
MachO::any_relocation_info RelInfo =
@@ -89,8 +90,7 @@ void RuntimeDyldMachO::makeValueAddendPCRel(RelocationValueRef &Value,
if (IsPCRel) {
uint64_t RelocAddr = 0;
RI->getAddress(RelocAddr);
- unsigned RelocSize = Obj.getAnyRelocationLength(RelInfo);
- Value.Addend += RelocAddr + (1ULL << RelocSize);
+ Value.Addend += RelocAddr + OffsetToNextPC;
}
}
OpenPOWER on IntegriCloud