about summary refs log tree commit diff
path: root/elf/dl-deps.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-09-14 04:25:14 +0000
committerUlrich Drepper <drepper@redhat.com>2001-09-14 04:25:14 +0000
commit23382b36a7f28c5205edd77bacf00fa7cbee9d53 (patch)
treeb963959d3ac8117e7c0fe285f90245c0576afa73 /elf/dl-deps.c
parent31a5468806fa75f49f7239f05eb7c857ee8a4191 (diff)
downloadglibc-23382b36a7f28c5205edd77bacf00fa7cbee9d53.tar.gz
glibc-23382b36a7f28c5205edd77bacf00fa7cbee9d53.tar.xz
glibc-23382b36a7f28c5205edd77bacf00fa7cbee9d53.zip
Update.
2001-09-13  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-deps.c (_dl_map_object_deps): Fix filter handling if filter
	is already found earlier in the search scope.

2001-09-12  Jakub Jelinek  <jakub@redhat.com>

	* rt/Makefile (LDFLAGS-rt.so): Use shared thread library as librt's
	filter.
Diffstat (limited to 'elf/dl-deps.c')
-rw-r--r--elf/dl-deps.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index 9d91d5ef00..ec61326614 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -362,11 +362,11 @@ _dl_map_object_deps (struct link_map *map,
 		    /* This object is already in the search list we
 		       are building.  Don't add a duplicate pointer.
 		       Just added by _dl_map_object.  */
-		    for (late = newp; late->next; late = late->next)
+		    for (late = newp; late->next != NULL; late = late->next)
 		      if (late->next->map == args.aux)
 			break;
 
-		    if (late->next)
+		    if (late->next != NULL)
 		      {
 			/* The object is somewhere behind the current
 			   position in the search path.  We have to
@@ -380,9 +380,9 @@ _dl_map_object_deps (struct link_map *map,
 			late->next = late->next->next;
 
 			/* We must move the object earlier in the chain.  */
-			if (args.aux->l_prev)
+			if (args.aux->l_prev != NULL)
 			  args.aux->l_prev->l_next = args.aux->l_next;
-			if (args.aux->l_next)
+			if (args.aux->l_next != NULL)
 			  args.aux->l_next->l_prev = args.aux->l_prev;
 
 			args.aux->l_prev = newp->map->l_prev;
@@ -394,21 +394,10 @@ _dl_map_object_deps (struct link_map *map,
 		    else
 		      {
 			/* The object must be somewhere earlier in the
-			   list.  That's good, we only have to insert
-			   an entry for the duplicate list.  */
-			orig->next = NULL;	/* Never used.  */
-
-			/* Now we have a problem.  The element
-			   pointing to ORIG in the list must
-			   point to NEWP now.  This is the only place
-			   where we need this backreference and this
-			   situation is really not that frequent.  So
-			   we don't use a double-linked list but
-			   instead search for the preceding element.  */
-			late = known;
-			while (late->next != orig)
-			  late = late->next;
-			late->next = newp;
+			   list.  Undo to the current list element what
+			   we did above.  */
+			memcpy (orig, newp, sizeof (*newp));
+			continue;
 		      }
 		  }
 		else