Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 25 Oct 2000 04:00:08 +0000 (04:00 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 25 Oct 2000 04:00:08 +0000 (04:00 +0000)
* elf/dl-lookup.c (add_dependency): Fix test to check whether
dependency already exists.
* elf/Makefile: Add testobj1 and testobj2 as dependencies of testobj6.
* elf/loadtest.c (main): Add test at the end that everything is
unloaded.

* elf/dl-open.c (dl_open_worker): Fix typo in comment.

ChangeLog
elf/Makefile
elf/dl-lookup.c
elf/dl-open.c
elf/loadtest.c

index 7fdc443..de078c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2000-10-24  Ulrich Drepper  <drepper@redhat.com>
 
+       * elf/dl-lookup.c (add_dependency): Fix test to check whether
+       dependency already exists.
+       * elf/Makefile: Add testobj1 and testobj2 as dependencies of testobj6.
+       * elf/loadtest.c (main): Add test at the end that everything is
+       unloaded.
+
+       * elf/dl-open.c (dl_open_worker): Fix typo in comment.
+
        * elf/elf.h: Add even more IA-64 relocations.
 
 2000-10-24  Geoffrey Keating  <geoffk@cygnus.com>
index 4441692..119cfa5 100644 (file)
@@ -246,7 +246,7 @@ $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl)
 $(objpfx)testobj3.so: $(libdl)
 $(objpfx)testobj4.so: $(libdl)
 $(objpfx)testobj5.so: $(libdl)
-$(objpfx)testobj6.so: $(libdl)
+$(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl)
 $(objpfx)failobj.so: $(objpfx)testobj6.so
 $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so
 $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so
index 581c6a6..9e0a25d 100644 (file)
@@ -97,14 +97,13 @@ add_dependency (struct link_map *undef_map, struct link_map *map)
 
   /* Determine whether UNDEF_MAP already has a reference to MAP.  First
      look in the normal dependencies.  */
-  list = undef_map->l_searchlist.r_list;
-  act = undef_map->l_searchlist.r_nlist;
+  list = undef_map->l_initfini;
 
-  for (i = 0; i < act; ++i)
+  for (i = 0; list[i] != NULL; ++i)
     if (list[i] == map)
       break;
 
-  if (__builtin_expect (i == act, 1))
+  if (__builtin_expect (list[i] == NULL, 1))
     {
       /* No normal dependency.  See whether we already had to add it
         to the special list of dynamic dependencies.  */
index b278e20..48bb9f8 100644 (file)
@@ -255,7 +255,7 @@ dl_open_worker (void *a)
                             "\n\n", NULL);
        }
 
-      /* If the user requested the object t be in the global namespace
+      /* If the user requested the object to be in the global namespace
         but it is not so far, add it now.  */
       if ((mode & RTLD_GLOBAL) && new->l_global == 0)
        (void) add_to_global (new);
index 25b2700..7cbe55b 100644 (file)
@@ -148,15 +148,27 @@ main (int argc, char *argv[])
   /* Unload all loaded modules.  */
   for (count = 0; count < NOBJS; ++count)
     if (testobjs[count].handle != NULL)
-{        printf ("\nclose: %s: l_initfini = %p, l_versions = %p\n",
-                 testobjs[count].name,
-                 ((struct link_map*)testobjs[count].handle)->l_initfini,
-                 ((struct link_map*)testobjs[count].handle)->l_versions);
-      if (dlclose (testobjs[count].handle) != 0)
-       {
-         printf ("failed to close %s\n", testobjs[count].name);
-         result = 1;
-}      }
+      {
+       printf ("\nclose: %s: l_initfini = %p, l_versions = %p\n",
+               testobjs[count].name,
+               ((struct link_map*)testobjs[count].handle)->l_initfini,
+               ((struct link_map*)testobjs[count].handle)->l_versions);
+
+       if (dlclose (testobjs[count].handle) != 0)
+         {
+           printf ("failed to close %s\n", testobjs[count].name);
+           result = 1;
+         }
+      }
+
+  /* Check whether all files are unloaded.  */
+  for (map = _r_debug.r_map; map != NULL; map = map->l_next)
+    if (map->l_type == lt_loaded)
+      {
+       printf ("name = \"%s\", opencount = %d\n",
+               map->l_name, (int) map->l_opencount);
+       result = 1;
+      }
 
   return result;
 }