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]

A patch for missing DSO


# 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



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

	* elf/dl-deps.c (_dl_map_object_deps): Pass the failed DSO
	filename to _dl_signal_error ().

--- elf/dl-deps.c.missing	Tue Apr 10 17:25:15 2001
+++ elf/dl-deps.c	Fri May 18 23:52:36 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.  */
@@ -582,5 +581,6 @@ out:
 
   if (errno_reason)
     _dl_signal_error (errno_reason == -1 ? 0 : errno_reason,
-		      errstring ?: "", N_("cannot load shared object file"));
+		      objname ?: "",
+		      errstring ?: N_("cannot load shared object file"));
 }


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