aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lli/RemoteMemoryManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lli/RemoteMemoryManager.cpp')
-rw-r--r--tools/lli/RemoteMemoryManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/lli/RemoteMemoryManager.cpp b/tools/lli/RemoteMemoryManager.cpp
index 04fc40e..e9f4d53 100644
--- a/tools/lli/RemoteMemoryManager.cpp
+++ b/tools/lli/RemoteMemoryManager.cpp
@@ -109,7 +109,7 @@ void RemoteMemoryManager::notifyObjectLoaded(ExecutionEngine *EE,
CurOffset += Size;
}
}
- // Adjust to keep code and data aligned on seperate pages.
+ // Adjust to keep code and data aligned on separate pages.
CurOffset = (CurOffset + MaxAlign - 1) / MaxAlign * MaxAlign;
for (size_t i = 0, e = NumSections; i != e; ++i) {
Allocation &Section = UnmappedSections[i];
@@ -129,7 +129,7 @@ void RemoteMemoryManager::notifyObjectLoaded(ExecutionEngine *EE,
// Allocate space in the remote target.
uint64_t RemoteAddr;
- if (Target->allocateSpace(CurOffset, MaxAlign, RemoteAddr))
+ if (!Target->allocateSpace(CurOffset, MaxAlign, RemoteAddr))
report_fatal_error(Target->getErrorMsg());
// Map the section addresses so relocations will get updated in the local
@@ -155,13 +155,13 @@ bool RemoteMemoryManager::finalizeMemory(std::string *ErrMsg) {
uint64_t RemoteAddr = I->first;
const Allocation &Section = I->second;
if (Section.IsCode) {
- Target->loadCode(RemoteAddr, Section.MB.base(), Section.MB.size());
-
+ if (!Target->loadCode(RemoteAddr, Section.MB.base(), Section.MB.size()))
+ report_fatal_error(Target->getErrorMsg());
DEBUG(dbgs() << " loading code: " << Section.MB.base()
<< " to remote: 0x" << format("%llx", RemoteAddr) << "\n");
} else {
- Target->loadData(RemoteAddr, Section.MB.base(), Section.MB.size());
-
+ if (!Target->loadData(RemoteAddr, Section.MB.base(), Section.MB.size()))
+ report_fatal_error(Target->getErrorMsg());
DEBUG(dbgs() << " loading data: " << Section.MB.base()
<< " to remote: 0x" << format("%llx", RemoteAddr) << "\n");
}