lli/RecordingMemoryManager.cpp: Make it complain if _GLOBAL_OFFSET_TABLE_ were not...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 21 Aug 2013 02:37:14 +0000 (02:37 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 21 Aug 2013 02:37:14 +0000 (02:37 +0000)
FIXME: Would it be responsible to provide GOT?
llvm-svn: 188855

llvm/tools/lli/RecordingMemoryManager.cpp

index 1fa8176..ec55d2c 100644 (file)
@@ -113,5 +113,12 @@ void *RecordingMemoryManager::getPointerToNamedFunction(const std::string &Name,
   // is called before ExecutionEngine::runFunctionAsMain() is called.
   if (Name == "__main") return (void*)(intptr_t)&jit_noop;
 
+  // FIXME: Would it be responsible to provide GOT?
+  if (AbortOnFailure) {
+    if (Name == "_GLOBAL_OFFSET_TABLE_")
+      report_fatal_error("Program used external function '" + Name +
+                         "' which could not be resolved!");
+  }
+
   return NULL;
 }