]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/loaders/preopen.c: Don't allow lt_dlopen if the
authorPeter O'Gorman <peter@pogma.com>
Mon, 3 Apr 2006 13:54:35 +0000 (13:54 +0000)
committerPeter O'Gorman <peter@pogma.com>
Mon, 3 Apr 2006 13:54:35 +0000 (13:54 +0000)
module has no symbols.

ChangeLog
libltdl/loaders/preopen.c

index 6b01cbf8a97f67d4b75a1c91611dc6b705e108b6..55892c25925e22f63b548b2e0d0d22158ac5fb4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-03  Peter O'Gorman  <peter@pogma.com>
+
+       * libltdl/loaders/preopen.c: Don't allow lt_dlopen if the
+       module has no symbols.
+
 2006-03-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) [ linux ]:
index 3ae8f43769787ac17485a29a79f01e7ef3f53ca0..afede08c559524d1b7931f8d6e70f186f7faf4cf 100644 (file)
@@ -163,8 +163,17 @@ vm_open (lt_user_data loader_data, const char *filename)
        {
          if (!symbol->address && streq (symbol->name, filename))
            {
-             module = (lt_module) lists->symlist;
-             goto done;
+             /* If the next symbol's name and address is 0, it means
+                the module just contains the originator and no symbols.
+                In this case we pretend that we never saw the module and
+                hope that some other loader will be able to load the module
+                and have access to its symbols */
+             const lt_dlsymlist *next_symbol = symbol +1;
+             if (next_symbol->address && next_symbol->name)
+               {
+                 module = (lt_module) lists->symlist;
+                 goto done;
+               }
            }
        }
     }