Fix assertion in ld.so, introduced by delayed adding to global list.
authorUlrich Drepper <drepper@gmail.com>
Tue, 26 Oct 2010 17:01:46 +0000 (13:01 -0400)
committerAndreas Schwab <schwab@redhat.com>
Wed, 1 Dec 2010 14:35:16 +0000 (15:35 +0100)
(cherry picked from commit fa41c84d73be804639ecb2250f0b793b1a6f765e)

ChangeLog
elf/rtld.c

index b097f0bc389a491cde55908cb2d30d4d3c692957..2d07ad1b4faee7738302c9286a61cd97d1fba6ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-26  Ulrich Drepper  <drepper@gmail.com>
+
+       * elf/rtld.c (dl_main): Move assertion after the point where rtld map
+       is added to the list.
+
 2010-10-24  Ulrich Drepper  <drepper@redhat.com>
 
        [BZ #12140]
index 48536c740ed1ad53f82ca7049e4d8006fd126c55..b451ab54f2dea259e481dbc656db94ed9f41de1f 100644 (file)
@@ -1108,7 +1108,6 @@ of this helper program; chances are you did not intend to run this program.\n\
       main_map = _dl_new_object ((char *) "", "", lt_executable, NULL,
                                 __RTLD_OPENEXEC, LM_ID_BASE);
       assert (main_map != NULL);
-      assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
       main_map->l_phdr = phdr;
       main_map->l_phnum = phnum;
       main_map->l_entry = *user_entry;
@@ -1116,6 +1115,7 @@ of this helper program; chances are you did not intend to run this program.\n\
       /* Even though the link map is not yet fully initialized we can add
         it to the map list since there are no possible users running yet.  */
       _dl_add_to_namespace_list (main_map, LM_ID_BASE);
+      assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
 
       /* At this point we are in a bit of trouble.  We would have to
         fill in the values for l_dev and l_ino.  But in general we