summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-21 06:32:16 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-21 06:32:16 +0000
commitc91bc73e3e463ae6a80e548b899703efae256090 (patch)
tree4ffca3b92929cba407f8c4dc68274d83ec697d90
parent8699e7b1daa5d250b8bc69e1ecffae80170277e5 (diff)
downloadglibc-c91bc73e3e463ae6a80e548b899703efae256090.tar.gz
glibc-c91bc73e3e463ae6a80e548b899703efae256090.tar.xz
glibc-c91bc73e3e463ae6a80e548b899703efae256090.zip
Update.
	* include/link.h (struct link_map): Add l_soname_added bitfield.
	* elf/dl-load.c (_dl_map_object): Remember when we added the
	SONAME to the l_libname list and don't try it again.
-rw-r--r--ChangeLog4
-rw-r--r--elf/dl-load.c4
-rw-r--r--include/link.h2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ba79bf8855..fb9cce5a07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2000-10-20  Ulrich Drepper  <drepper@redhat.com>
 
+	* include/link.h (struct link_map): Add l_soname_added bitfield.
+	* elf/dl-load.c (_dl_map_object): Remember when we added the
+	SONAME to the l_libname list and don't try it again.
+
 	* elf/dl-close.c: Decrement opencount for all dependencies which can
 	be removed even if the object is not yet unloaded.
 	* elf/dl-deps.c (_dl_map_object_deps): If dependency is already in
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 55725c3cb3..978a81c30d 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1413,7 +1413,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
 	{
 	  const char *soname;
 
-	  if (l->l_info[DT_SONAME] == NULL)
+	  if (__builtin_expect (l->l_soname_added, 1)
+	      || l->l_info[DT_SONAME] == NULL)
 	    continue;
 
 	  soname = ((const char *) D_PTR (l, l_info[DT_STRTAB])
@@ -1423,6 +1424,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
 
 	  /* We have a match on a new name -- cache it.  */
 	  add_name_to_object (l, soname);
+	  l->l_soname_added = 1;
 	}
 
       /* We have a match -- bump the reference count and return it.  */
diff --git a/include/link.h b/include/link.h
index 0eab781428..4c04099891 100644
--- a/include/link.h
+++ b/include/link.h
@@ -178,6 +178,8 @@ struct link_map
     unsigned int l_reserved:2;	/* Reserved for internal use.  */
     unsigned int l_phdr_allocated:1; /* Nonzero if the data structure pointed
 					to by `l_phdr' is allocated.  */
+    unsigned int l_soname_added:1; /* Nonzero if the SONAME is for sure in
+				      the l_libname list.  */
 
     /* Array with version names.  */
     unsigned int l_nversions;