[padb] r321 committed - If dlopen fails to resolve symbols using RTLD_NOW report an error to...

padb at googlecode.com padb at googlecode.com
Thu Nov 5 22:08:57 GMT 2009


Revision: 321
Author: apittman
Date: Thu Nov  5 14:07:46 2009
Log: If dlopen fails to resolve symbols using RTLD_NOW report an error to
the user and retry with RTLD_LAZY.  I believe this means the process
can die with SIGBUS at any point should the unknown symbol actually
be called but that's a problem with the dll and not with minfo.

http://code.google.com/p/padb/source/detail?r=321

Modified:
  /trunk/src/minfo.c

=======================================
--- /trunk/src/minfo.c	Thu Nov  5 14:04:01 2009
+++ /trunk/src/minfo.c	Thu Nov  5 14:07:46 2009
@@ -528,8 +528,13 @@
      void *dlhandle;

      dlhandle = dlopen(filename,RTLD_NOW);
-    if ( ! dlhandle )
-	return -1;
+    if ( ! dlhandle ) {
+	show_warning("Unable to dlopen dll with RTLD_NOW, trying LAZY...");
+	show_warning(dlerror());
+	dlhandle = dlopen(filename,RTLD_LAZY);
+	if ( ! dlhandle )
+	    return -1;
+    }

      DLSYM(dll_ep,dlhandle,setup_basic_callbacks);
      DLSYM(dll_ep,dlhandle,setup_image);



More information about the padb-devel mailing list