forked from OSchip/llvm-project
Change to use LinkDynamicObject instead of dlopen.
llvm-svn: 9011
This commit is contained in:
parent
e5e53229fc
commit
0cf2da2b03
|
@ -10,6 +10,7 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "Support/DynamicLinker.h"
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
#include "Config/dlfcn.h"
|
#include "Config/dlfcn.h"
|
||||||
#include "Config/link.h"
|
#include "Config/link.h"
|
||||||
|
@ -18,8 +19,9 @@
|
||||||
namespace {
|
namespace {
|
||||||
struct PluginLoader {
|
struct PluginLoader {
|
||||||
void operator=(const std::string &Filename) {
|
void operator=(const std::string &Filename) {
|
||||||
if (dlopen(Filename.c_str(), RTLD_NOW|RTLD_GLOBAL) == 0)
|
std::string ErrorMessage;
|
||||||
std::cerr << "Error opening '" << Filename << "': " << dlerror()
|
if (LinkDynamicObject (Filename.c_str (), &ErrorMessage))
|
||||||
|
std::cerr << "Error opening '" << Filename << "': " << ErrorMessage
|
||||||
<< "\n -load request ignored.\n";
|
<< "\n -load request ignored.\n";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue