summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-12-31 07:39:50 +0000
committerUlrich Drepper <drepper@redhat.com>2000-12-31 07:39:50 +0000
commit09f5e1635ae75de077c5307d02fdbefc4b0c7144 (patch)
treeb328e9ca3e582fd022a6832277f764b20f0586cf /elf
parentc77a447822c8ccc6866216bad737189fff3a0b93 (diff)
downloadglibc-09f5e1635ae75de077c5307d02fdbefc4b0c7144.tar.gz
glibc-09f5e1635ae75de077c5307d02fdbefc4b0c7144.tar.xz
glibc-09f5e1635ae75de077c5307d02fdbefc4b0c7144.zip
Update.
2000-12-28  Wolfram Gloger  <wg@malloc.de>

	* malloc/malloc.c (MALLOC_COPY): Handle case if source and
	destination overlap.  Assume dest is always below source if
	overlapping.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-open.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index d1ccfd4ada..0170d1c0fb 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -269,10 +269,6 @@ dl_open_worker (void *a)
   /* Load that object's dependencies.  */
   _dl_map_object_deps (new, NULL, 0, 0);
 
-  /* Increment the open count for all dependencies.  */
-  for (i = 0; i < new->l_searchlist.r_nlist; ++i)
-    ++new->l_searchlist.r_list[i]->l_opencount;
-
   /* So far, so good.  Now check the versions.  */
   for (i = 0; i < new->l_searchlist.r_nlist; ++i)
     if (new->l_searchlist.r_list[i]->l_versions == NULL)
@@ -321,6 +317,10 @@ dl_open_worker (void *a)
       l = l->l_prev;
     }
 
+  /* Increment the open count for all dependencies.  */
+  for (i = 0; i < new->l_searchlist.r_nlist; ++i)
+    ++new->l_searchlist.r_list[i]->l_opencount;
+
   /* Run the initializer functions of new objects.  */
   _dl_init (new, __libc_argc, __libc_argv, __environ);
 
@@ -399,11 +399,10 @@ _dl_open (const char *file, int mode, const void *caller)
 	{
 	  int i;
 
-	  /* Increment open counters for all objects which did not get
-	     correctly loaded.  */
+	  /* Increment open counters for all objects since this has
+	     not happened yet.  */
 	  for (i = 0; i < args.map->l_searchlist.r_nlist; ++i)
-	    if (args.map->l_searchlist.r_list[i]->l_opencount == 0)
-	      args.map->l_searchlist.r_list[i]->l_opencount = 1;
+	    ++args.map->l_searchlist.r_list[i]->l_opencount;
 
 	  _dl_close (args.map);
 	}