summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld
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
commit6a465cd8efbe4ac9a1d789eb5d51e771197ecb74 (patch)
treecf7acb13ba0933c865debd126f6a1fa01abc268b /llvm/lib/ExecutionEngine/RuntimeDyld
parent54289619bff81759a8ae3e8b194e4bfc16a6e5dc (diff)
downloadbcm5719-llvm-6a465cd8efbe4ac9a1d789eb5d51e771197ecb74.tar.gz
bcm5719-llvm-6a465cd8efbe4ac9a1d789eb5d51e771197ecb74.zip
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 llvm-svn: 163765
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index 4fd7bc99c36..465e85d7d91 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud