aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/DynamicLinker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-25 16:55:32 +0000
committerChris Lattner <sabre@nondot.org>2003-10-25 16:55:32 +0000
commit764486f5e4b2531a9b6f3bac44072c67090a6445 (patch)
tree04e79989f364c86693ae87a5e8453da2d30bd017 /lib/Support/DynamicLinker.cpp
parentb8afbe61394d77467406de0b0b3d5b134fd036ae (diff)
Attempt to provide support for those without RTLD_DEFAULT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/DynamicLinker.cpp')
-rw-r--r--lib/Support/DynamicLinker.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Support/DynamicLinker.cpp b/lib/Support/DynamicLinker.cpp
index 05a63f3d76..74b3603679 100644
--- a/lib/Support/DynamicLinker.cpp
+++ b/lib/Support/DynamicLinker.cpp
@@ -37,8 +37,13 @@ bool LinkDynamicObject (const char *filename, std::string *ErrorMessage) {
void *GetAddressOfSymbol (const char *symbolName) {
#if defined (HAVE_DLOPEN)
+#ifdef RTLD_DEFAULT
return dlsym (RTLD_DEFAULT, symbolName);
#else
+ static void* CurHandle = dlopen(0, RTLD_LAZY);
+ return dlsym(CurHandle, symbolName);
+#endif
+#else
assert (0 && "Dynamic symbol lookup not implemented for this platform");
#endif
}