This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

more RELACOUNT stufff


Actually, the do-rel.h file as is will probably need this patch:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: do-rel.h
===================================================================
RCS file: /cvs/glibc/libc/elf/do-rel.h,v
retrieving revision 1.20
diff -u -d -u -p -r1.20 do-rel.h
--- do-rel.h	2001/08/24 08:40:21	1.20
+++ do-rel.h	2001/08/24 09:23:46
@@ -59,9 +59,22 @@ elf_dynamic_do_rel (struct link_map *map
 	(const void *) D_PTR (map, l_info[DT_SYMTAB]);
       ElfW(Word) nrelative = (map->l_info[RELCOUNT_IDX] == NULL
 			      ? 0 : map->l_info[RELCOUNT_IDX]->d_un.d_val);
-      const ElfW(Rel) *endrel = end;
-      end -= nrelative;
+      const ElfW(Rel) *endrel = r + nrelative;
 
+#ifndef RTLD_BOOTSTRAP
+      /* This is defined in rtld.c, but nowhere in the static libc.a; make
+	 the reference weak so static programs can still link.  This
+	 declaration cannot be done when compiling rtld.c (i.e. #ifdef
+	 RTLD_BOOTSTRAP) because rtld.c contains the common defn for
+	 _dl_rtld_map, which is incompatible with a weak decl in the same
+	 file.  */
+      weak_extern (_dl_rtld_map);
+      if (map != &_dl_rtld_map) /* Already done in rtld itself.  */
+#endif
+	for (; r < endrel; ++r)
+	  elf_machine_rel_relative (l_addr, r,
+				    (void *) (l_addr + r->r_offset));
+
       if (map->l_info[VERSYMIDX (DT_VERSYM)])
 	{
 	  const ElfW(Half) *const version =
@@ -79,20 +92,6 @@ elf_dynamic_do_rel (struct link_map *map
 	for (; r < end; ++r)
 	  elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL,
 			   (void *) (l_addr + r->r_offset));
-
-#ifndef RTLD_BOOTSTRAP
-      /* This is defined in rtld.c, but nowhere in the static libc.a; make
-	 the reference weak so static programs can still link.  This
-	 declaration cannot be done when compiling rtld.c (i.e. #ifdef
-	 RTLD_BOOTSTRAP) because rtld.c contains the common defn for
-	 _dl_rtld_map, which is incompatible with a weak decl in the same
-	 file.  */
-      weak_extern (_dl_rtld_map);
-      if (map != &_dl_rtld_map) /* Already done in rtld itself.  */
-#endif
-	for (; r < endrel; ++r)
-	  elf_machine_rel_relative (l_addr, r,
-				    (void *) (l_addr + r->r_offset));
     }
 }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But this requires that Jakub changes his patch to move the relative
relocations first.  He's investigating in the moment whether this is
the right thing to do.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]