This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix filter handling (was Re: rt/Makefile)


On Wed, Sep 12, 2001 at 04:23:07PM -0700, Ulrich Drepper wrote:
> Jakub's rt/Makefile change is backed out, it broke the build (and
> therefore also programs).  Try running linuxthreads/ex10 .

That's because dl-deps.c is broken.
If a filter is found earlier in the search scope, it means basically nothing
should be done (aside from adding it to needed array), but the code below
used to needlessly switch pointers and what's worse, runp would suddenly
point to a library which was done already, but with runp->done 0 (so it
would be added twice) and also any further search scope additions would go
to this orphaned list which is not linked from anywhere.
In ex10 case, ld.so would be added to this orphaned list and thus would not
appear in ex10's searchlist.
Bootstrapped (with the -Wl,-F patch), passed make check, I've tested
ex10 linked against -lpthread -lrt, -lrt -lpthread and -lrt only too.

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.

--- libc/elf/dl-deps.c.jj	Wed Sep 12 09:56:33 2001
+++ libc/elf/dl-deps.c	Thu Sep 13 11:22:25 2001
@@ -394,21 +394,9 @@ _dl_map_object_deps (struct link_map *ma
 		    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.  */
+			memcpy (orig, newp, sizeof (*newp));
+			continue;
 		      }
 		  }
 		else


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]