summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-03-22 18:19:42 +0000
committerJim Grosbach <grosbach@apple.com>2011-03-22 18:19:42 +0000
commit40411cc409370b01fd0920fa65148bcebf50e1d1 (patch)
tree880fb4d7c952b9b789def93dbf54112ec7704b63
parentd52744086f6edca9414dc2b14e48c9fe6fa9818d (diff)
downloadbcm5719-llvm-40411cc409370b01fd0920fa65148bcebf50e1d1.tar.gz
bcm5719-llvm-40411cc409370b01fd0920fa65148bcebf50e1d1.zip
Propogate the error message, not just the error state.
llvm-svn: 128094
-rw-r--r--llvm/include/llvm/ExecutionEngine/RuntimeDyld.h1
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp5
-rw-r--r--llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp5
3 files changed, 9 insertions, 2 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
index 629dccff234..2b5a6918172 100644
--- a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
+++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
@@ -38,6 +38,7 @@ public:
// FIXME: Should be parameterized to get the memory block associated with
// a particular loaded object.
sys::MemoryBlock getMemoryBlock();
+ StringRef getErrorString();
};
} // end namespace llvm
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index a57055eb8d2..aa4f2f9ad0b 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -334,4 +334,9 @@ sys::MemoryBlock RuntimeDyld::getMemoryBlock() {
return Dyld->getMemoryBlock();
}
+StringRef RuntimeDyld::getErrorString()
+{
+ return Dyld->getErrorString();
+}
+
} // end namespace llvm
diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
index 4e224261cbf..286a3f251d8 100644
--- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -63,8 +63,9 @@ static int executeInput() {
RuntimeDyld Dyld;
// Load the object file into it.
- if (Dyld.loadObject(InputBuffer.take()))
- return true;
+ if (Dyld.loadObject(InputBuffer.take())) {
+ return Error(Dyld.getErrorString());
+ }
// Get the address of "_main".
void *MainAddress = Dyld.getSymbolAddress("_main");
OpenPOWER on IntegriCloud