From: Peter O'Gorman Date: Mon, 3 Apr 2006 13:54:35 +0000 (+0000) Subject: * libltdl/loaders/preopen.c: Don't allow lt_dlopen if the X-Git-Tag: release-2-1b~302 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cd0ad1319dfd2dcccf3784ccdec8526838b2203;p=thirdparty%2Flibtool.git * libltdl/loaders/preopen.c: Don't allow lt_dlopen if the module has no symbols. --- diff --git a/ChangeLog b/ChangeLog index 6b01cbf8a..55892c259 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-03 Peter O'Gorman + + * libltdl/loaders/preopen.c: Don't allow lt_dlopen if the + module has no symbols. + 2006-03-28 Ralf Wildenhues * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) [ linux ]: diff --git a/libltdl/loaders/preopen.c b/libltdl/loaders/preopen.c index 3ae8f4376..afede08c5 100644 --- a/libltdl/loaders/preopen.c +++ b/libltdl/loaders/preopen.c @@ -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; + } } } }