[llvm-commits] CVS: llvm/lib/System/Unix/DynamicLibrary.cpp

Reid Spencer reid at x10sys.com
Mon Nov 29 02:39:57 PST 2004



Changes in directory llvm/lib/System/Unix:

DynamicLibrary.cpp updated: 1.1 -> 1.2
---
Log message:

Implement the default constructor which causes the current program to be
opened as if it was a dynamic library so its symbols can be searched too.


---
Diffs of the changes:  (+9 -1)

Index: llvm/lib/System/Unix/DynamicLibrary.cpp
diff -u llvm/lib/System/Unix/DynamicLibrary.cpp:1.1 llvm/lib/System/Unix/DynamicLibrary.cpp:1.2
--- llvm/lib/System/Unix/DynamicLibrary.cpp:1.1	Wed Nov 17 22:33:40 2004
+++ llvm/lib/System/Unix/DynamicLibrary.cpp	Mon Nov 29 04:39:46 2004
@@ -16,8 +16,16 @@
 namespace llvm {
 using namespace sys;
 
+DynamicLibrary::DynamicLibrary() : handle(0) {
+#if defined (HAVE_DLOPEN)
+  if ((handle = dlopen(0, RTLD_NOW | RTLD_GLOBAL)) == 0)
+    throw std::string( dlerror() );
+#else
+  assert(!"Dynamic object linking not implemented for this platform");
+#endif
+}
 
-DynamicLibrary::DynamicLibrary(const char *filename) {
+DynamicLibrary::DynamicLibrary(const char *filename) : handle(0) {
 #if defined (HAVE_DLOPEN)
   if ((handle = dlopen (filename, RTLD_NOW | RTLD_GLOBAL)) == 0)
     throw std::string( dlerror() );






More information about the llvm-commits mailing list