Change got[1] flag for MIPS
jaeger@informatik.uni-kl.de
jaeger@informatik.uni-kl.de
Tue Apr 4 18:29:00 GMT 2000
Last August there was a discussion on the binutils list started by
Ralf Baechle about "elf32-mips breaks binary compatibility" (see
< http://sourceware.cygnus.com/ml/binutils/1999-q3/msg00446.html >).
I propose to add the following patch to binutils (I discussed the
patch with Ralf). glibc needs also to be changed (the patch is small
and easy). This way we get binary compatibility with older binutils
again.
Andreas
2000-04-04 Andreas Jaeger <aj@suse.de>
* elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Change
value of got[1] to mark this as a file generated by new binutils.
Index: bfd/elf32-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mips.c,v
retrieving revision 1.60
diff -u -p -r1.60 elf32-mips.c
--- elf32-mips.c 2000/03/11 02:23:10 1.60
+++ elf32-mips.c 2000/04/05 01:21:58
@@ -8668,7 +8668,15 @@ _bfd_mips_elf_finish_dynamic_sections (o
if (sgot != NULL && sgot->_raw_size > 0)
{
MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0, sgot->contents);
- MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000,
+ /* Older binutils used to write 0x80000000. The value has been
+ changed to signal that newer binutils are used. We do need
+ to differentiate because older binutils generated some wrong
+ relocations - and the dynamic linker has to work around this.
+ Since this bug is fixed, the workaround has to be disabled.
+ For details see the thread "elf32-mips breaks binary
+ compatibility" at
+ < http://sourceware.cygnus.com/ml/binutils/1999-q3/msg00446.html >. */
+ MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0xC0000000,
sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
}
--
Andreas Jaeger
SuSE Labs aj@suse.de
More information about the Binutils
mailing list