about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--elf/dl-deps.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d7e9df2efe..49cad44081 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2002-04-02  Ulrich Drepper  <drepper@redhat.com>
 
+	* elf/dl-deps.c (_dl_map_object_deps): The sorting of the
+	dependencies must be stable to work correctly.
+	Reported by martin.lubich@datacon.at.
+
 	* libio/bug-ungetwc1.c: New file.
 	* libio/Makefile (tests): Add bug-ungetwc1.
 
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index 6dac54ab23..9fd2dd23ef 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -614,6 +614,10 @@ Filters not supported with LD_TRACE_PRELINKING"));
 			     (k - j) * sizeof (struct link_map *));
 		    map->l_initfini[j] = here;
 
+		    /* Don't insert further matches before the last
+		       entry moved to the front.  */
+		    ++j;
+
 		    break;
 		  }
 	    }