From 9bae38af55c9cedd84b8d1a40dc3bec6abce872c Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Fri, 9 Jan 2015 09:40:58 +0100 Subject: [PATCH] Check for missing symbols found during relocations. --- lib/Interpreter/IncrementalExecutor.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Interpreter/IncrementalExecutor.cpp b/lib/Interpreter/IncrementalExecutor.cpp index d3df9f6d..3b5dcb42 100644 --- a/lib/Interpreter/IncrementalExecutor.cpp +++ b/lib/Interpreter/IncrementalExecutor.cpp @@ -283,8 +283,15 @@ IncrementalExecutor::runStaticInitializersOnce(llvm::Module* m) { ~AtExitModuleSetterRAII() { m_AEM = 0; } } DSOHandleSetter(m, m_CurrentAtExitModule); + // We don't care whether something was unresolved before. + m_unresolvedSymbols.clear(); + m_engine->finalizeObject(); + // check if there is any unresolved symbol in the list + if (diagnoseUnresolvedSymbols("static initializers")) + return kExeUnresolvedSymbols; + llvm::GlobalVariable* GV = m->getGlobalVariable("llvm.global_ctors", true); // Nothing to do is good, too. @@ -307,9 +314,6 @@ IncrementalExecutor::runStaticInitializersOnce(llvm::Module* m) { if (InitList == 0) return kExeSuccess; - // We don't care whether something was unresolved before. - m_unresolvedSymbols.clear(); - SmallVector initFuncs; for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {