about summary refs log tree commit diff
path: root/elf/dl-lookup.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-21 06:02:49 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-21 06:02:49 +0000
commit8699e7b1daa5d250b8bc69e1ecffae80170277e5 (patch)
tree6ee2841f9875e4bf2d1f73f1539b0ad3bd9b5406 /elf/dl-lookup.c
parentf6de2239e2cb1af87b36dbd8712bd27f42ae7d54 (diff)
downloadglibc-8699e7b1daa5d250b8bc69e1ecffae80170277e5.tar.gz
glibc-8699e7b1daa5d250b8bc69e1ecffae80170277e5.tar.xz
glibc-8699e7b1daa5d250b8bc69e1ecffae80170277e5.zip
Update.
	* 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
	the list decrement opencount of all dependencies.
	* elf/dl-load.c (_dl_map_object_from_fd): Increment object of object
	and all dependencies.
	(_dl_map_object): Likewise.
	* elf/dl-lookup.c (add_dependency): Likewise.

	* elf/loadtest.c: Add debug when with more output.
Diffstat (limited to 'elf/dl-lookup.c')
-rw-r--r--elf/dl-lookup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 581c6a6c2b..d9476817c3 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -129,6 +129,8 @@ add_dependency (struct link_map *undef_map, struct link_map *map)
 
 	  if (runp != NULL)
 	    {
+	      unsigned int j;
+
 	      /* The object is still available.  Add the reference now.  */
 	      if (__builtin_expect (act >= undef_map->l_reldepsmax, 0))
 		{
@@ -158,7 +160,11 @@ add_dependency (struct link_map *undef_map, struct link_map *map)
 	      if (__builtin_expect (act < undef_map->l_reldepsmax, 1))
 		undef_map->l_reldeps[undef_map->l_reldepsact++] = map;
 
-	      /* And increment the counter in the referenced object.  */
+	      /* And increment the counter in the referenced object
+                 and its dependencies.  */
+	      if (map->l_initfini != NULL)
+		for (j = 1; map->l_initfini[j] != NULL; ++j)
+		  ++map->l_initfini[j]->l_opencount;
 	      ++map->l_opencount;
 
 	      /* Display information if we are debugging.  */