diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-11-29 14:11:29 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-11-29 14:11:29 +0000 |
commit | 70e37278cb3b9fa934ad01d0a6e70993ee1c0988 (patch) | |
tree | 146545cc0ae3660ef16fb42639772ff4c15f4fa6 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 9ec2761bb76d6c305821cc623ab5fb680ea4ddd6 (diff) | |
download | bcm5719-llvm-70e37278cb3b9fa934ad01d0a6e70993ee1c0988.tar.gz bcm5719-llvm-70e37278cb3b9fa934ad01d0a6e70993ee1c0988.zip |
Use System/DynamicLibrary instead of Support/DynamicLinker
llvm-svn: 18357
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 812bec184d9..e4ff7d4c4b9 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -19,13 +19,13 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" +#include "llvm/ADT/Statistic.h" #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/GenericValue.h" -#include "llvm/Target/TargetData.h" #include "llvm/Support/Debug.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/Support/DynamicLinker.h" +#include "llvm/System/DynamicLibrary.h" +#include "llvm/Target/TargetData.h" using namespace llvm; namespace { @@ -151,7 +151,13 @@ ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP, } } - if (EE == 0) delete IL; + if (EE == 0) + delete IL; + else + // Make sure we can resolve symbols in the program as well. The zero arg + // to the function tells DynamicLibrary to load the program, not a library. + sys::DynamicLibrary::LoadLibraryPermanently(0); + return EE; } @@ -502,7 +508,8 @@ void ExecutionEngine::emitGlobals() { } else { // External variable reference. Try to use the dynamic loader to // get a pointer to it. - if (void *SymAddr = GetAddressOfSymbol(I->getName().c_str())) + if (void *SymAddr = sys::DynamicLibrary::SearchForAddressOfSymbol( + I->getName().c_str())) addGlobalMapping(I, SymAddr); else { std::cerr << "Could not resolve external global address: " |