On Fri, 2006-03-24 at 08:26 +0900, Peter O'Gorman wrote: > On Thu, 2006-03-23 at 00:29 +0900, Peter O'Gorman wrote: > > On Tue, 2006-03-21 at 18:11 +0100, Ralf Wildenhues wrote: > > > I think it should still work without prepending. > > > Won't that change the dlopener order on newer MAC OS X? > > > > > > This may be the same bug that Charles reported on Cygwin long ago, that > > > after LoadLibrary failed dlopen was not tried? > > > > Hi Ralf, > > Is this okay? > > This patch is incorrect, sorry.
Okay, we sometimes get modules that have just the originator name, and the end of list. In this case we should fail to open the module. Is this okay? Peter
Index: ChangeLog
2006-03-24 Peter O'Gorman <[EMAIL PROTECTED]>
* libltdl/loaders/preopen.c: Don't allow lt_dlopen if the
module has no symbols.
* libltdl/loaders/dlopen.c (get_vtable): Use LT_DLLOADER_APPEND.
from Ralf Wildenhues <[EMAIL PROTECTED]>
Index: libltdl/loaders/dlopen.c
===================================================================
RCS file: /sources/libtool/libtool/libltdl/loaders/dlopen.c,v
retrieving revision 1.5
diff -u -r1.5 dlopen.c
--- libltdl/loaders/dlopen.c 22 Apr 2005 10:10:30 -0000 1.5
+++ libltdl/loaders/dlopen.c 24 Mar 2006 00:08:24 -0000
@@ -69,7 +69,7 @@
vtable->module_close = vm_close;
vtable->find_sym = vm_sym;
vtable->dlloader_data = loader_data;
- vtable->priority = LT_DLLOADER_PREPEND;
+ vtable->priority = LT_DLLOADER_APPEND;
}
if (vtable && (vtable->dlloader_data != loader_data))
Index: libltdl/loaders/preopen.c
===================================================================
RCS file: /sources/libtool/libtool/libltdl/loaders/preopen.c,v
retrieving revision 1.7
diff -u -r1.7 preopen.c
--- libltdl/loaders/preopen.c 22 Apr 2005 10:10:30 -0000 1.7
+++ libltdl/loaders/preopen.c 24 Mar 2006 00:08:24 -0000
@@ -163,8 +163,17 @@
{
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;
+ }
}
}
}
signature.asc
Description: This is a digitally signed message part
