summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
diff options
context:
space:
mode:
authorKeno Fischer <kfischer@college.harvard.edu>2015-05-21 21:24:32 +0000
committerKeno Fischer <kfischer@college.harvard.edu>2015-05-21 21:24:32 +0000
commitc780e8ebcc50930088d57cbba788fb0d307ab170 (patch)
tree2611b492103c536894377fdff3ec1ead3ca61e48 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
parent6f0d522475aea588dc8997f5806dd37464eaebaf (diff)
downloadbcm5719-llvm-c780e8ebcc50930088d57cbba788fb0d307ab170.tar.gz
bcm5719-llvm-c780e8ebcc50930088d57cbba788fb0d307ab170.zip
Make it easier to use DwarfContext with MCJIT
Summary: This supersedes http://reviews.llvm.org/D4010, hopefully properly dealing with the JIT case and also adds an actual test case. DwarfContext was basically already usable for the JIT (and back when we were overwriting ELF files it actually worked out of the box by accident), but in order to resolve relocations correctly it needs to know the load address of the section. Rather than trying to get this out of the ObjectFile or requiring the user to create a new ObjectFile just to get some debug info, this adds the capability to pass in that info directly. As part of this I separated out part of the LoadedObjectInfo struct from RuntimeDyld, since it is now required at a higher layer. Reviewers: lhames, echristo Reviewed By: echristo Subscribers: vtjnash, friss, rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D6961 llvm-svn: 237961
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index 675063c81d6..796a69cc836 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -36,6 +36,8 @@ public:
getObjectForDebug(const ObjectFile &Obj) const override {
return OwningBinary<ObjectFile>();
}
+
+ RuntimeDyld::LoadedObjectInfo *clone() const { return new LoadedMachOObjectInfo(*this); }
};
}
@@ -75,7 +77,7 @@ RelocationValueRef RuntimeDyldMachO::getRelocationValueRef(
Value.Offset = RE.Addend;
}
} else {
- SectionRef Sec = Obj.getRelocationSection(RelInfo);
+ SectionRef Sec = Obj.getAnyRelocationSection(RelInfo);
bool IsCode = Sec.isText();
Value.SectionID = findOrEmitSection(Obj, Sec, IsCode, ObjSectionToID);
uint64_t Addr = Sec.getAddress();
OpenPOWER on IntegriCloud