From 0927dab0be5cec078df693663f5445dd2cc66670 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 27 Aug 2014 17:51:43 +0000 Subject: [PATCH] Revert "Limit the symbol search in DynamicLibrary to the module that was opened." This reverts commit r216563, which breaks lli's dynamic symbol resolution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216569 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/DynamicLibrary.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp index 40072636608..d2b551e8a0a 100644 --- a/lib/Support/DynamicLibrary.cpp +++ b/lib/Support/DynamicLibrary.cpp @@ -56,15 +56,8 @@ static DenseSet *OpenedHandles = nullptr; DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename, std::string *errMsg) { SmartScopedLock lock(*SymbolsMutex); - int flags = RTLD_LAZY | RTLD_GLOBAL; -#if defined(__APPLE__) - // RTLD_FIRST is an apple specific flag which causes dlsym() to search only - // the module specified in |filename|, and not dependent modules. This - // behavior would be desirable for other platforms as well, except that - // there's not a good way to implement it. - flags |= RTLD_FIRST; -#endif - void *handle = dlopen(filename, flags); + + void *handle = dlopen(filename, RTLD_LAZY|RTLD_GLOBAL); if (!handle) { if (errMsg) *errMsg = dlerror(); return DynamicLibrary(); -- 2.34.1