summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2013-10-11 22:47:10 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2013-10-11 22:47:10 +0000
commit4bad07fbec9d42769fdc5cea891f8cb7a3b284d5 (patch)
treee6ec41a1be2ad6cbb480f60037bc11a7e4b77c8f /tools
parent528f6d787b1a847e61eb2f1114559f423fdeb68c (diff)
downloadllvm-4bad07fbec9d42769fdc5cea891f8cb7a3b284d5.tar.gz
llvm-4bad07fbec9d42769fdc5cea891f8cb7a3b284d5.tar.bz2
llvm-4bad07fbec9d42769fdc5cea891f8cb7a3b284d5.tar.xz
Fixing problems in lli's RemoteMemoryManager.
This fixes a problem from a previous check-in where a return value was omitted. Previously the remote/stubs-remote.ll and remote/stubs-sm-pic.ll tests were reporting passes, but they should have been failing. Those tests attempt to link against an external symbol and remote symbol resolution is not supported. The old RemoteMemoryManager implementation resulted in local symbols being used for resolution and the child process crashed but the test didn't notice. With this check-in remote symbol resolution fails, and so the test (correctly) fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/lli/RemoteMemoryManager.h2
-rw-r--r--tools/lli/lli.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/lli/RemoteMemoryManager.h b/tools/lli/RemoteMemoryManager.h
index eabe042fff..16d0a808b9 100644
--- a/tools/lli/RemoteMemoryManager.h
+++ b/tools/lli/RemoteMemoryManager.h
@@ -78,7 +78,7 @@ public:
// interface does support this, but clients must provide their own
// mechanism for finding remote symbol addresses. MCJIT will resolve
// symbols from Modules it contains.
- uint64_t getSymbolAddress(const std::string &Name) {}
+ uint64_t getSymbolAddress(const std::string &Name) { return 0; }
void notifyObjectLoaded(ExecutionEngine *EE, const ObjectImage *Obj);
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 5578a1da31..7117707691 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -398,18 +398,18 @@ int main(int argc, char **argv, char * const *envp) {
return -1;
}
- // If the program doesn't explicitly call exit, we will need the Exit
- // function later on to make an explicit call, so get the function now.
- Constant *Exit = Mod->getOrInsertFunction("exit", Type::getVoidTy(Context),
- Type::getInt32Ty(Context),
- NULL);
-
// Reset errno to zero on entry to main.
errno = 0;
int Result;
if (!RemoteMCJIT) {
+ // If the program doesn't explicitly call exit, we will need the Exit
+ // function later on to make an explicit call, so get the function now.
+ Constant *Exit = Mod->getOrInsertFunction("exit", Type::getVoidTy(Context),
+ Type::getInt32Ty(Context),
+ NULL);
+
// Run static constructors.
if (UseMCJIT && !ForceInterpreter) {
// Give MCJIT a chance to apply relocations and set page permissions.