diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index b2a268bce8b..cb825904cc2 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -659,7 +659,7 @@ void *JIT::getPointerToFunction(Function *F) { return Addr; } - if (F->isDeclaration()) { + if (F->isDeclaration() || F->hasAvailableExternallyLinkage()) { bool AbortOnFailure = !areDlsymStubsEnabled() && !F->hasExternalWeakLinkage(); void *Addr = getPointerToNamedFunction(F->getName(), AbortOnFailure);