[llvm] r216569 - Revert "Limit the symbol search in DynamicLibrary to the module that was opened."

Zachary Turner zturner at google.com
Wed Aug 27 10:51:44 PDT 2014


Author: zturner
Date: Wed Aug 27 12:51:43 2014
New Revision: 216569

URL: http://llvm.org/viewvc/llvm-project?rev=216569&view=rev
Log:
Revert "Limit the symbol search in DynamicLibrary to the module that was opened."

This reverts commit r216563, which breaks lli's dynamic symbol resolution.

Modified:
    llvm/trunk/lib/Support/DynamicLibrary.cpp

Modified: llvm/trunk/lib/Support/DynamicLibrary.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/DynamicLibrary.cpp?rev=216569&r1=216568&r2=216569&view=diff
==============================================================================
--- llvm/trunk/lib/Support/DynamicLibrary.cpp (original)
+++ llvm/trunk/lib/Support/DynamicLibrary.cpp Wed Aug 27 12:51:43 2014
@@ -56,15 +56,8 @@ static DenseSet<void *> *OpenedHandles =
 DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename,
                                                    std::string *errMsg) {
   SmartScopedLock<true> 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();





More information about the llvm-commits mailing list