1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Revert "Limit the symbol search in DynamicLibrary to the module that was opened."

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

llvm-svn: 216569
This commit is contained in:
Zachary Turner 2014-08-27 17:51:43 +00:00
parent 423f4f9c6c
commit a302d24004

View File

@ -56,15 +56,8 @@ static DenseSet<void *> *OpenedHandles = nullptr;
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();