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]
Other format: [Raw text]

patch for arm


libc 2.3 doesn't compile on arm at the moment.  These patches seem to
fix the problem.

p.

2002-07-12  Philip Blundell  <philb@gnu.org>

	* sysdeps/arm/dl-machine.h (elf_machine_rel): Don't handle
	R_ARM_RELATIVE if RTLD_BOOTSTRAP and HAVE_Z_COMBRELOC.  Only check
	for rtld map if neither RTLD_BOOTSTRAP nor HAVE_Z_COMBRELOC is defined.
	(elf_machine_rela): Remove unused variable.

	* sysdeps/unix/sysv/linux/arm/Makefile [subdir=elf] 
	(sysdep-rtld-routines, sysdep_routines, sysdep-dl-routines): Don't define.


Index: sysdeps/arm/dl-machine.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/arm/dl-machine.h,v
retrieving revision 1.38
diff -u -r1.38 dl-machine.h
--- sysdeps/arm/dl-machine.h	1 Mar 2002 09:43:35 -0000	1.38
+++ sysdeps/arm/dl-machine.h	12 Jul 2002 21:52:36 -0000
@@ -422,10 +422,20 @@
 {
   const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
 
+#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
   if (__builtin_expect (r_type == R_ARM_RELATIVE, 0))
     {
-# ifndef RTLD_BOOTSTRAP
-      if (map != &_dl_rtld_map) /* Already done in rtld itself.  */
+# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
+      /* 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.  */
+#  ifndef SHARED
+      weak_extern (_dl_rtld_map);
+#  endif
+      if (map != &GL(dl_rtld_map)) /* Already done in rtld itself.  */
 # endif
 	*reloc_addr += map->l_addr;
     }
@@ -434,6 +444,7 @@
     return;
 # endif
   else
+#endif
     {
       const Elf32_Sym *const refsym = sym;
       Elf32_Addr value = RESOLVE (&sym, version, r_type);
@@ -483,7 +494,7 @@
 #  ifndef SHARED
 	    weak_extern (_dl_rtld_map);
 #  endif
-	    if (map == &_dl_rtld_map)
+	    if (map == &GL(dl_rtld_map))
 	      /* Undo the relocation done here during bootstrapping.
 		 Now we will relocate it anew, possibly using a
 		 binding found in the user program or a loaded library
@@ -541,7 +552,6 @@
     return;
   else
     {
-      const Elf32_Sym *const refsym = sym;
       Elf32_Addr value = RESOLVE (&sym, version, r_type);
       if (sym)
 	value += sym->st_value;

Index: sysdeps/unix/sysv/linux/arm/Makefile
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/arm/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- sysdeps/unix/sysv/linux/arm/Makefile	24 Mar 2002 01:55:18 -0000	1.14
+++ sysdeps/unix/sysv/linux/arm/Makefile	12 Jul 2002 21:52:43 -0000
@@ -12,11 +12,3 @@
 ifeq ($(subdir),resource)
 sysdep_routines += oldgetrlimit64
 endif
-
-ifeq ($(subdir),elf)
-# extra shared linker files to link into dl-allobjs.so and libc
-sysdep-dl-routines += dl-procinfo
-sysdep_routines += dl-procinfo
-# extra shared linker files to link only into dl-allobjs.so
-sysdep-rtld-routines += dl-procinfo
-endif





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