summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2015-09-10 20:44:36 +0000
committerLang Hames <lhames@gmail.com>2015-09-10 20:44:36 +0000
commit79fce4711b9e718449b70f394cd9a8fea7534ae2 (patch)
treea887af9d12a14a4135df486f96b62e7c13ae06a7 /llvm/lib/ExecutionEngine
parent2e4ca848f45f08fec084e886280a2e45e48b6e1b (diff)
downloadbcm5719-llvm-79fce4711b9e718449b70f394cd9a8fea7534ae2.tar.gz
bcm5719-llvm-79fce4711b9e718449b70f394cd9a8fea7534ae2.zip
[RuntimeDyld] Fix a bug in debugging output: all sections should be dumped
before any relocations have been applied, and again after all relocations have been applied. Previously each section was dumped before and after relocations targetting it were applied, but this only shows the impact of relocations that point to other symbols in the same section. llvm-svn: 247335
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 42a0205331b..a2557cbb055 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -82,6 +82,12 @@ static void dumpSectionMemory(const SectionEntry &S, StringRef State) {
void RuntimeDyldImpl::resolveRelocations() {
MutexGuard locked(lock);
+ // Print out the sections prior to relocation.
+ DEBUG(
+ for (int i = 0, e = Sections.size(); i != e; ++i)
+ dumpSectionMemory(Sections[i], "before relocations");
+ );
+
// First, resolve relocations associated with external symbols.
resolveExternalSymbols();
@@ -94,11 +100,16 @@ void RuntimeDyldImpl::resolveRelocations() {
uint64_t Addr = Sections[i].LoadAddress;
DEBUG(dbgs() << "Resolving relocations Section #" << i << "\t"
<< format("%p", (uintptr_t)Addr) << "\n");
- DEBUG(dumpSectionMemory(Sections[i], "before relocations"));
resolveRelocationList(Relocations[i], Addr);
- DEBUG(dumpSectionMemory(Sections[i], "after relocations"));
Relocations.erase(i);
}
+
+ // Print out sections after relocation.
+ DEBUG(
+ for (int i = 0, e = Sections.size(); i != e; ++i)
+ dumpSectionMemory(Sections[i], "after relocations");
+ );
+
}
void RuntimeDyldImpl::mapSectionAddress(const void *LocalAddress,
OpenPOWER on IntegriCloud