summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-01-29 18:31:35 +0000
committerLang Hames <lhames@gmail.com>2014-01-29 18:31:35 +0000
commit2cbbdf41c061fff572b354ac8549432709f1fe35 (patch)
tree0814b6bfe375ef3b720b5531f1f047cdf573df78 /llvm/lib/ExecutionEngine
parent9e16c8ac8af288c739cb33bbb6e1bdf33043d60d (diff)
downloadbcm5719-llvm-2cbbdf41c061fff572b354ac8549432709f1fe35.tar.gz
bcm5719-llvm-2cbbdf41c061fff572b354ac8549432709f1fe35.zip
Add support for PC-relative non-extern relocations to RuntimeDyldMachO.
Also replaces testcase for r180790 (support for absolute non-externs relocs) with a more robust version. <rdar://problem/15864721> llvm-svn: 200404
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index d12e7e5e4dc..0408337fff7 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -382,6 +382,8 @@ void RuntimeDyldMachO::processRelocationRef(unsigned SectionID,
uint64_t Addr;
Sec.getAddress(Addr);
Value.Addend = Addend - Addr;
+ if (IsPCRel)
+ Value.Addend += Offset + NumBytes;
}
if (Arch == Triple::x86_64 && (RelType == MachO::X86_64_RELOC_GOT ||
OpenPOWER on IntegriCloud