diff options
Diffstat (limited to 'llvm/lib/Support/PluginLoader.cpp')
| -rw-r--r-- | llvm/lib/Support/PluginLoader.cpp | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/llvm/lib/Support/PluginLoader.cpp b/llvm/lib/Support/PluginLoader.cpp index 76c5e8197df..4cacd016133 100644 --- a/llvm/lib/Support/PluginLoader.cpp +++ b/llvm/lib/Support/PluginLoader.cpp @@ -10,6 +10,7 @@  //  //===----------------------------------------------------------------------===// +#include "Support/DynamicLinker.h"  #include "Support/CommandLine.h"  #include "Config/dlfcn.h"  #include "Config/link.h" @@ -18,9 +19,10 @@  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";	      }    };  } | 

