about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-12 16:33:05 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-12 16:33:05 +0000
commitb2bcd61a998237708b86c601844fe9585a26cf9c (patch)
treee94917f0fb3e629e93a583efed771be8dc2b15af
parenteb242eda564fc7c48bc93c7e58b5075d122e9c1c (diff)
downloadglibc-b2bcd61a998237708b86c601844fe9585a26cf9c.tar.gz
glibc-b2bcd61a998237708b86c601844fe9585a26cf9c.tar.xz
glibc-b2bcd61a998237708b86c601844fe9585a26cf9c.zip
Update.
1999-07-12  Andreas Schwab  <schwab@suse.de>

	* elf/rtld.c (dl_main): When putting back the interpreter object
	handle the case where a missing object might occur in the list of
	objects but not in the search list when in trace mode.
-rw-r--r--ChangeLog6
-rw-r--r--elf/rtld.c15
2 files changed, 18 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ec8d64aa8..a88d0b4007 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-07-12  Andreas Schwab  <schwab@suse.de>
+
+	* elf/rtld.c (dl_main): When putting back the interpreter object
+	handle the case where a missing object might occur in the list of
+	objects but not in the search list when in trace mode.
+
 1999-07-11  Ulrich Drepper  <drepper@cygnus.com>
 
 	* Versions.def (libnss_hesiod): Add GLIBC_2.2.
diff --git a/elf/rtld.c b/elf/rtld.c
index 4146c0e9bf..33c26269fc 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -798,9 +798,18 @@ of this helper program; chances are you did not intend to run this program.\n\
       while (_dl_loaded->l_searchlist.r_list[i] != &_dl_rtld_map)
 	++i;
       _dl_rtld_map.l_prev = _dl_loaded->l_searchlist.r_list[i - 1];
-      _dl_rtld_map.l_next = (i + 1 < _dl_loaded->l_searchlist.r_nlist
-			     ? _dl_loaded->l_searchlist.r_list[i + 1]
-			     : NULL);
+      if (__builtin_expect (mode, normal) == normal)
+	_dl_rtld_map.l_next = (i + 1 < _dl_loaded->l_searchlist.r_nlist
+			       ? _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.  */
+	_dl_rtld_map.l_next = _dl_rtld_map.l_prev->l_next;
+
       assert (_dl_rtld_map.l_prev->l_next == _dl_rtld_map.l_next);
       _dl_rtld_map.l_prev->l_next = &_dl_rtld_map;
       if (_dl_rtld_map.l_next)