open plugins with RTLD_GLOBAL, pointed out by Bram Adams.
llvm-svn: 53385
diff --git a/llvm/lib/System/DynamicLibrary.cpp b/llvm/lib/System/DynamicLibrary.cpp
index 572ba49..5e3b6cb 100644
--- a/llvm/lib/System/DynamicLibrary.cpp
+++ b/llvm/lib/System/DynamicLibrary.cpp
@@ -61,7 +61,7 @@
bool DynamicLibrary::LoadLibraryPermanently(const char *Filename,
std::string *ErrMsg) {
- void *H = dlopen(Filename, RTLD_LAZY);
+ void *H = dlopen(Filename, RTLD_LAZY|RTLD_GLOBAL);
if (H == 0) {
if (ErrMsg)
*ErrMsg = dlerror();