This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

NEW PATCH: Re: A patch for missing DSO


On Sat, May 19, 2001 at 12:09:59AM -0700, H . J . Lu wrote:
> # ldd ./foo
>         lib-a.so => not found
>         libc.so.6 => /lib/libc.so.6 (0x40027000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
> # ./foo
> ./foo: error while loading shared libraries: cannot open shared object file: cannot load shared object file: No such file or directory
> 
> It is not very helpful. With this patch, I got
> 
> # ./foo
> ./foo: error while loading shared libraries: lib-a.so: cannot open shared object file: No such file or directory
> 
> 
> 

Here is an updated patch. We should just ignore all errors from
DT_AUXILIARY by making objname and errstring local to DT_AUXILIARY.
Also there is no need to check objname and errstring since they
should be set by an error return from _dl_catch_error ().


H.J.
----
2001-05-19  H.J. Lu  <hjl@gnu.org>

	* elf/dl-deps.c (_dl_map_object_deps): Pass objname and
	errstring of the failed DSO to _dl_signal_error (). Ignore
	all error info from DT_AUXILIARY.

--- libc/elf/dl-deps.c.missing	Tue Apr 10 17:25:15 2001
+++ libc/elf/dl-deps.c	Sat May 19 19:54:08 2001
@@ -146,6 +146,7 @@ _dl_map_object_deps (struct link_map *ma
   int errno_saved;
   int errno_reason;
   const char *errstring;
+  const char *objname;
 
   auto inline void preload (struct link_map *map);
 
@@ -237,7 +238,6 @@ _dl_map_object_deps (struct link_map *ma
 		struct link_map *dep;
 		/* Allocate new entry.  */
 		struct list *newp;
-		const char *objname;
 
 		/* Recognize DSTs.  */
 		name = expand_dst (l, strtab + d->d_un.d_val, 0);
@@ -281,7 +281,6 @@ _dl_map_object_deps (struct link_map *ma
 	      }
 	    else if (d->d_tag == DT_AUXILIARY || d->d_tag == DT_FILTER)
 	      {
-		const char *objname;
 		struct list *newp;
 
 		/* Recognize DSTs.  */
@@ -292,6 +291,9 @@ _dl_map_object_deps (struct link_map *ma
 
 		if (d->d_tag == DT_AUXILIARY)
 		  {
+		    const char *errstring;
+		    const char *objname;
+
 		    /* Say that we are about to load an auxiliary library.  */
 		    if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
 		      _dl_debug_printf ("load auxiliary object=%s"
@@ -307,7 +309,6 @@ _dl_map_object_deps (struct link_map *ma
 			assert (errstring != NULL);
 			if (errstring != _dl_out_of_memory)
 			  free ((char *) errstring);
-			errstring = NULL;
 
 			/* Simply ignore this error and continue the work.  */
 			continue;
@@ -582,5 +583,5 @@ out:
 
   if (errno_reason)
     _dl_signal_error (errno_reason == -1 ? 0 : errno_reason,
-		      errstring ?: "", N_("cannot load shared object file"));
+		      objname, errstring);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]