Don't compile _dl_resolve_conflicts if there's no RELA support

Guido Guenther agx@sigxcpu.org
Fri Mar 14 09:42:00 GMT 2003


On Thu, Mar 13, 2003 at 10:06:02PM -0300, Alexandre Oliva wrote:
> On Mar 13, 2003, Alexandre Oliva <aoliva@redhat.com> wrote:
> 
> > _dl_resolve_conflicts assumes elf_machine_rela exists, and it's only
> > called in rtld.c in a chunk of code that is protected by
> > `! ELF_MACHINE_NO_RELA' as well.
> 
> err...  The chunk is only protected in my tree, anyway.  I withdraw
> this patch for now.
I'm using the attached patch by H.J. Lu since quiet some time to get
glibc to build at all. I cooked up a changelog entry, can this go in?
Regards,
 -- Guido
-------------- next part --------------
2003-03-14  H.J. Lu  <hjl@gnu.org>

	* elf/dl-conflict.c: Conditionalize _dl_resolve_conflicts on
	  ! _DL_HAVE_NO_ELF_MACHINE_RELA.
	* sysdeps/mips/dl-machine.h: define _DL_HAVE_NO_ELF_MACHINE_RELA
	  for mips.

--- elf/dl-conflict.c.mips	Mon Feb  4 13:44:57 2002
+++ elf/dl-conflict.c	Mon Feb  4 15:10:31 2002
@@ -33,6 +33,7 @@ void
 _dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict,
 		       ElfW(Rela) *conflictend)
 {
+#ifndef _DL_HAVE_NO_ELF_MACHINE_RELA
   if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_RELOC, 0))
     _dl_printf ("\nconflict processing: %s\n",
 		l->l_name[0] ? l->l_name : _dl_argv[0]);
@@ -63,4 +64,5 @@ _dl_resolve_conflicts (struct link_map *
     for (; conflict < conflictend; ++conflict)
       elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset);
   }
+#endif
 }
--- sysdeps/mips/dl-machine.h.mips	Mon Feb  4 13:45:18 2002
+++ sysdeps/mips/dl-machine.h	Mon Feb  4 15:08:39 2002
@@ -56,6 +56,9 @@
 #define ELF_MACHINE_JMP_SLOT			R_MIPS_REL32
 #define elf_machine_type_class(type)		ELF_RTYPE_CLASS_PLT
 
+/* MIPS doesn't support RELA.  */
+#define _DL_HAVE_NO_ELF_MACHINE_RELA
+
 /* Translate a processor specific dynamic tag to the index
    in l_info array.  */
 #define DT_MIPS(x) (DT_MIPS_##x - DT_LOPROC + DT_NUM)



More information about the Libc-alpha mailing list