[llvm-commits] CVS: llvm/lib/Support/PluginLoader.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Fri Oct 10 12:02:01 PDT 2003
Changes in directory llvm/lib/Support:
PluginLoader.cpp updated: 1.4 -> 1.5
---
Log message:
Change to use LinkDynamicObject instead of dlopen.
---
Diffs of the changes: (+5 -3)
Index: llvm/lib/Support/PluginLoader.cpp
diff -u llvm/lib/Support/PluginLoader.cpp:1.4 llvm/lib/Support/PluginLoader.cpp:1.5
--- llvm/lib/Support/PluginLoader.cpp:1.4 Mon Jul 28 14:19:58 2003
+++ llvm/lib/Support/PluginLoader.cpp Fri Oct 10 12:01:49 2003
@@ -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";
}
};
}
More information about the llvm-commits
mailing list