about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-09-02 20:19:26 +0000
committerRoland McGrath <roland@gnu.org>2002-09-02 20:19:26 +0000
commitd89ae1d5efcbaf58ed541d22966a4fb3f8094f9d (patch)
tree63d748b7c692048309a15cbd628646d9b5907f54
parent14a6e35c544562f276b89312ea3f221a6a4146d3 (diff)
downloadglibc-d89ae1d5efcbaf58ed541d22966a4fb3f8094f9d.tar.gz
glibc-d89ae1d5efcbaf58ed541d22966a4fb3f8094f9d.tar.xz
glibc-d89ae1d5efcbaf58ed541d22966a4fb3f8094f9d.zip
2002-09-02 Jakub Jelinek <jakub@redhat.com>
        * elf/rtld.c (dl_main): If prelinking succeeded, mark all objects
        as relocated.
-rw-r--r--ChangeLog5
-rw-r--r--elf/rtld.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 65e2a780c8..fa8e13382a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-02  Jakub Jelinek  <jakub@redhat.com>
+
+        * elf/rtld.c (dl_main): If prelinking succeeded, mark all objects
+        as relocated.
+
 2002-09-02  Jack Howarth  <howarth@bromo.msbb.uc.edu>
 
 	* sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.
diff --git a/elf/rtld.c b/elf/rtld.c
index 54e1903eef..273926ef53 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1405,6 +1405,8 @@ cannot allocate TLS data structures for initial thread");
 
   if (prelinked)
     {
+      struct link_map *l;
+
       if (GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL)
 	{
 	  ElfW(Rela) *conflict, *conflictend;
@@ -1416,15 +1418,20 @@ cannot allocate TLS data structures for initial thread");
 	  HP_TIMING_NOW (start);
 	  assert (GL(dl_loaded)->l_info [VALIDX (DT_GNU_CONFLICTSZ)] != NULL);
 	  conflict = (ElfW(Rela) *)
-		     GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_CONFLICT)]->d_un.d_ptr;
+	    GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_CONFLICT)]->d_un.d_ptr;
 	  conflictend = (ElfW(Rela) *)
-			((char *) conflict
-			 + GL(dl_loaded)->l_info [VALIDX (DT_GNU_CONFLICTSZ)]->d_un.d_val);
+	    ((char *) conflict
+	     + GL(dl_loaded)->l_info [VALIDX (DT_GNU_CONFLICTSZ)]->d_un.d_val);
 	  _dl_resolve_conflicts (GL(dl_loaded), conflict, conflictend);
 	  HP_TIMING_NOW (stop);
 	  HP_TIMING_DIFF (relocate_time, start, stop);
 	}
 
+
+      /* Mark all the objects so we know they have been already relocated.  */
+      for (l = GL(dl_loaded); l != NULL; l = l->l_next)
+	l->l_relocated = 1;
+
       _dl_sysdep_start_cleanup ();
     }
   else