diff -ruN libtool-1.3.5/ChangeLog libtool-1.3.5.1/ChangeLog --- libtool-1.3.5/ChangeLog Sat May 27 07:12:27 2000 +++ libtool-1.3.5.1/ChangeLog Mon Mar 19 19:43:19 2001 @@ -1,3 +1,6 @@ +2001-03-19 Ahmed Masud + * ltdl.c: shl_load support for HPUX fixed for filename == NULL + 2000-05-27 Gary V. Vaughan GNU libtool 1.3.5 was released. diff -ruN libtool-1.3.5/libltdl/ltdl.c libtool-1.3.5.1/libltdl/ltdl.c --- libtool-1.3.5/libltdl/ltdl.c Tue Nov 2 07:36:23 1999 +++ libtool-1.3.5.1/libltdl/ltdl.c Mon Mar 19 19:44:00 2001 @@ -381,10 +381,17 @@ lt_dlhandle handle; const char *filename; { - handle->handle = shl_load(filename, LTDL_BIND_FLAGS, 0L); - if (!handle->handle) { - last_error = cannot_open_error; - return 1; + if ( filename == NULL ) { + /* NULL points to self and everything already loaded if + exported with a -E */ + handle->handle = NULL; + } + else { + handle->handle = shl_load(filename, LTDL_BIND_FLAGS, 0L); + if (!handle->handle) { + last_error = cannot_open_error; + return 1; + } } return 0; } @@ -393,7 +400,7 @@ sys_shl_close (handle) lt_dlhandle handle; { - if (shl_unload((shl_t) (handle->handle)) != 0) { + if (handle->handle && shl_unload((shl_t) (handle->handle)) != 0) { last_error = cannot_close_error; return 1; } @@ -406,11 +413,16 @@ const char *symbol; { lt_ptr_t address; - - if (handle->handle && shl_findsym((shl_t*) &(handle->handle), - symbol, TYPE_UNDEFINED, &address) == 0) - if (address) - return address; + int looking_at_null = 0, retval; + /* handle->handle can be NULL, it searches every thing */ + if ( !handle->handle ) + looking_at_null = 1; + retval = shl_findsym((shl_t*) &(handle->handle), symbol, TYPE_UNDEFINED, &address); + if ( looking_at_null ) { + handle->handle = NULL; + } + if ((retval == 0) && address) + return address; last_error = symbol_error; return 0; } @@ -1619,3 +1631,4 @@ { return user_search_path; } +