summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-09-13 01:24:37 +0000
committerJim Grosbach <grosbach@apple.com>2012-09-13 01:24:37 +0000
commit7639f98c5fc903339bf50e574aee999d54340cdf (patch)
treeb733de85a60dcf79eab7631d9a835318b66b337c /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
parent01e1a97021da37588ebaf94352984cd566729c4e (diff)
downloadllvm-7639f98c5fc903339bf50e574aee999d54340cdf.tar.gz
llvm-7639f98c5fc903339bf50e574aee999d54340cdf.tar.bz2
llvm-7639f98c5fc903339bf50e574aee999d54340cdf.tar.xz
MCJIT: relocation addends encoded in the target aren't quite so easy.
The assumption that the target address for the relocation will always be sizeof(intptr_t) and will always contain an addend for the relocation value is very wrong. Default to no addend for now. rdar://12157052 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index 4fd7bc99c3..465e85d7d9 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -246,7 +246,12 @@ void RuntimeDyldMachO::processRelocationRef(const ObjRelocationInfo &Rel,
}
assert(si != se && "No section containing relocation!");
Value.SectionID = findOrEmitSection(Obj, *si, true, ObjSectionToID);
- Value.Addend = *(const intptr_t *)Target;
+ Value.Addend = 0;
+ // FIXME: The size and type of the relocation determines if we can
+ // encode an Addend in the target location itself, and if so, how many
+ // bytes we should read in order to get it. We don't yet support doing
+ // that, and just assuming it's sizeof(intptr_t) is blatantly wrong.
+ //Value.Addend = *(const intptr_t *)Target;
if (Value.Addend) {
// The MachO addend is an offset from the current section. We need it
// to be an offset from the destination section