This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mips: disable combreloc for NEWABI


As explained in the comments introduced in the patch below, combreloc
breaks with the n64 ABI, because n64 packs three consecutive
relocations in one.  I've only noticed problems on n64, but n32 also
composes relocations, so I thought I'd leave combreloc disabled for it
too.  I might also have gone ahead and disabled combreloc for all mips
emulations, since the only dynamic relocation is RELATIVE anyway, so
there's no benefit in combining relocations.  Thoughts?  Ok to
install?

Index: bfd/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* elfxx-mips.c (_bfd_mips_elf_final_link): Disable combreloc
	if linking for NEWABI.

Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.27
diff -u -p -r1.27 elfxx-mips.c
--- bfd/elfxx-mips.c 13 Oct 2002 21:22:31 -0000 1.27
+++ bfd/elfxx-mips.c 19 Oct 2002 21:17:19 -0000
@@ -7591,6 +7591,14 @@ _bfd_mips_elf_final_link (abfd, info)
 	}
     }
 
+  if (NEWABI_P (abfd))
+    /* Ugh!  We can't let elflink.h sort relocations because our
+       relocation swap-in and swap-out routines assume an array of
+       relocations and it may write/read from multiple ones at a time,
+       but elf_link_sort_relocs uses an array of struct
+       elf_link_sort_rela.  */
+    info->combreloc = 0;
+
   /* Invoke the regular ELF backend linker to do all the work.  */
   if (ABI_64_P (abfd))
     {
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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