aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-29 17:24:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-29 17:24:34 +0000
commit87b5017139e9d8ac9b046b3284a9cc68c76185d6 (patch)
treeceda3137641902b9f35259515b770c20cf4cf9e2 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
parentefa91f6475f6e96552986104ab4857db46185a2a (diff)
downloadexternal_llvm-87b5017139e9d8ac9b046b3284a9cc68c76185d6.zip
external_llvm-87b5017139e9d8ac9b046b3284a9cc68c76185d6.tar.gz
external_llvm-87b5017139e9d8ac9b046b3284a9cc68c76185d6.tar.bz2
Propagate relocation info to resolveRelocation.
This gets most of the MCJITs tests passing with MachO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 7884f46..d843e9a 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -391,26 +391,14 @@ void RuntimeDyldImpl::reassignSectionAddress(unsigned SectionID,
Sections[SectionID].LoadAddress = Addr;
}
-void RuntimeDyldImpl::resolveRelocationEntry(const RelocationEntry &RE,
- uint64_t Value) {
- // Ignore relocations for sections that were not loaded
- if (Sections[RE.SectionID].Address != 0) {
- DEBUG(dbgs() << "\tSectionID: " << RE.SectionID
- << " + " << RE.Offset << " ("
- << format("%p", Sections[RE.SectionID].Address + RE.Offset) << ")"
- << " RelType: " << RE.RelType
- << " Addend: " << RE.Addend
- << "\n");
-
- resolveRelocation(Sections[RE.SectionID], RE.Offset,
- Value, RE.RelType, RE.Addend);
- }
-}
-
void RuntimeDyldImpl::resolveRelocationList(const RelocationList &Relocs,
uint64_t Value) {
for (unsigned i = 0, e = Relocs.size(); i != e; ++i) {
- resolveRelocationEntry(Relocs[i], Value);
+ const RelocationEntry &RE = Relocs[i];
+ // Ignore relocations for sections that were not loaded
+ if (Sections[RE.SectionID].Address == 0)
+ continue;
+ resolveRelocation(RE, Value);
}
}