Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
Date: 2004-04-18
Initial Package Version: 2.3.3
Origin: glibc CVS
Description: Fixes seg fault when trying execute any library
 
--- glibc-2.3.3-20031202/elf/rtld.c.orig	2004-04-18 22:21:35.395006171 +0000
+++ glibc-2.3.3-20031202/elf/rtld.c	2004-04-18 22:21:59.199590135 +0000
@@ -1244,19 +1244,7 @@
       while (GL(dl_loaded)->l_searchlist.r_list[i] != &GL(dl_rtld_map))
 	++i;
       GL(dl_rtld_map).l_prev = GL(dl_loaded)->l_searchlist.r_list[i - 1];
-      if (__builtin_expect (mode, normal) == normal)
-	GL(dl_rtld_map).l_next = (i + 1 < GL(dl_loaded)->l_searchlist.r_nlist
-				  ? GL(dl_loaded)->l_searchlist.r_list[i + 1]
-				  : NULL);
-      else
-	/* In trace mode there might be an invisible object (which we
-	   could not find) after the previous one in the search list.
-	   In this case it doesn't matter much where we put the
-	   interpreter object, so we just initialize the list pointer so
-	   that the assertion below holds.  */
-	GL(dl_rtld_map).l_next = GL(dl_rtld_map).l_prev->l_next;
-
-      assert (GL(dl_rtld_map).l_prev->l_next == GL(dl_rtld_map).l_next);
+      GL(dl_rtld_map).l_next = GL(dl_rtld_map).l_prev->l_next;
       GL(dl_rtld_map).l_prev->l_next = &GL(dl_rtld_map);
       if (GL(dl_rtld_map).l_next != NULL)
 	{
