Change to use LinkDynamicObject instead of dlopen.
authorBrian Gaeke <gaeke@uiuc.edu>
Fri, 10 Oct 2003 17:01:49 +0000 (17:01 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Fri, 10 Oct 2003 17:01:49 +0000 (17:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9011 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/PluginLoader.cpp

index 76c5e8197df4bbd00294760026fb18aa1138ca30..4cacd01613368a7e82f4126c20379ff4739f56a0 100644 (file)
@@ -10,6 +10,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "Support/DynamicLinker.h"
 #include "Support/CommandLine.h"
 #include "Config/dlfcn.h"
 #include "Config/link.h"
 namespace {
   struct PluginLoader {
     void operator=(const std::string &Filename) {
-      if (dlopen(Filename.c_str(), RTLD_NOW|RTLD_GLOBAL) == 0)
-        std::cerr << "Error opening '" << Filename << "': " << dlerror()
-                  << "\n  -load request ignored.\n";
+      std::string ErrorMessage;
+      if (LinkDynamicObject (Filename.c_str (), &ErrorMessage))
+        std::cerr << "Error opening '" << Filename << "': " << ErrorMessage
+                  << "\n  -load request ignored.\n";   
     }
   };
 }