diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2012-11-05 20:57:16 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2012-11-05 20:57:16 +0000 |
commit | 28989889bf3aa3314562d438aece245b71176ec4 (patch) | |
tree | fbb752fbef5ca0b065c72dfc34f0b1d6b674a5a7 /tools | |
parent | 86aef0a4f093700420c76f313e5668c39db110aa (diff) | |
download | llvm-28989889bf3aa3314562d438aece245b71176ec4.tar.gz llvm-28989889bf3aa3314562d438aece245b71176ec4.tar.bz2 llvm-28989889bf3aa3314562d438aece245b71176ec4.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lli/lli.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 9a27a4c941..d41a595de8 100644 --- a/tools/lli/lli.cpp +++ b/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; |