summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2012-11-05 20:57:16 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2012-11-05 20:57:16 +0000
commita714efc1bd14b37db33677844572ebb40ab3ace2 (patch)
treeb5f5e989e54892a9bf100ae937755bf50e6a74f0 /llvm/tools/lli
parent10b4f2a20c5945da6ab2ff5abc2d683750383684 (diff)
downloadbcm5719-llvm-a714efc1bd14b37db33677844572ebb40ab3ace2.tar.gz
bcm5719-llvm-a714efc1bd14b37db33677844572ebb40ab3ace2.zip
Add a method to indicate section address re-assignment is finished.
Prior to this patch RuntimeDyld attempted to re-apply relocations every time reassignSectionAddress was called (via MCJIT::mapSectionAddress). In addition to being inefficient and redundant, this led to a problem when a section was temporarily moved too far away from another section with a relative relocation referencing the section being moved. To fix this, I'm adding a new method (finalizeObject) which the client can call to indicate that it is finished rearranging section addresses so the relocations can safely be applied. llvm-svn: 167400
Diffstat (limited to 'llvm/tools/lli')
-rw-r--r--llvm/tools/lli/lli.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 9a27a4c9411..d41a595de85 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -475,6 +475,10 @@ void layoutRemoteTargetMemory(RemoteTarget *T, RecordingMemoryManager *JMM) {
<< " to remote: " << format("%p", Addr) << "\n");
}
+
+ // Trigger application of relocations
+ EE->finalizeObject();
+
// Now load it all to the target.
for (unsigned i = 0, e = Offsets.size(); i != e; ++i) {
uint64_t Addr = RemoteAddr + Offsets[i].second;
OpenPOWER on IntegriCloud