X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=binutils-mips-relocs.patch;h=b172d29c79a59ac36e346756d4a89682e5e907eb;hb=b4f91c33cf8555e7ba2348df56e90c6ab99c1695;hp=9a5f41cc1b61d3f3a464c0b234794483ea499899;hpb=18cf57569165423d54a4bd893b10cbec1c562fe1;p=packages%2Fcrossppc-binutils.git diff --git a/binutils-mips-relocs.patch b/binutils-mips-relocs.patch index 9a5f41c..b172d29 100644 --- a/binutils-mips-relocs.patch +++ b/binutils-mips-relocs.patch @@ -101,54 +101,27 @@ diff -u -r1.2114 ChangeLog + (tc_gen_reloc): Put back pc rel handling. + * config/tc-mips.h: Defines DIFF_EXPR_OK. + -Index: gas/config/tc-mips.c -=================================================================== -RCS file: /cvsroot/gcc/src-cvs/src/gas/config/tc-mips.c,v -retrieving revision 1.263 -diff -u -r1.263 tc-mips.c ---- gas/config/tc-mips.c 29 Apr 2004 05:14:21 -0000 1.263 -+++ gas/config/tc-mips.c 5 May 2004 17:38:51 -0000 -@@ -10861,8 +10861,7 @@ +--- gas/config/tc-mips.c.orig 2006-07-15 20:23:51.000000000 +0200 ++++ gas/config/tc-mips.c 2006-07-17 10:51:06.164440000 +0200 +@@ -11736,8 +11736,6 @@ + buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where); - /* We are not done if this is a composite relocation to set up gp. */ -- assert (! fixP->fx_pcrel); -- if (fixP->fx_addsy == NULL -+ if (fixP->fx_addsy == NULL && ! fixP->fx_pcrel - && !(fixP->fx_r_type == BFD_RELOC_MIPS_SUB - || (fixP->fx_r_type == BFD_RELOC_64 - && (previous_fx_r_type == BFD_RELOC_GPREL32 -@@ -12723,8 +12722,27 @@ - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; +- assert (!fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2); +- + /* Don't treat parts of a composite relocation as done. There are two + reasons for this: -- assert (! fixp->fx_pcrel); -- reloc->addend = fixp->fx_addnumber; -+ if (fixp->fx_pcrel) -+ { -+ bfd_vma pcrel_address; -+ -+ pcrel_address = reloc->address; -+ -+ if (OUTPUT_FLAVOR == bfd_target_elf_flavour) -+ { -+ /* At this point, fx_addnumber is "symbol offset - pcrel_address". -+ Relocations want only the symbol offset. */ -+ reloc->addend = fixp->fx_addnumber + pcrel_address; -+ } -+ else -+ { -+ /* A gruesome hack which is a result of the gruesome gas reloc -+ handling. */ -+ reloc->addend = pcrel_address; -+ } -+ } -+ else -+ reloc->addend = fixp->fx_addnumber; +@@ -13562,8 +13560,6 @@ - /* Since the old MIPS ELF ABI uses Rel instead of Rela, encode the vtable - entry to be used in the relocation's section offset. */ -@@ -12735,6 +12753,34 @@ + if (fixp->fx_pcrel) + { +- assert (fixp->fx_r_type == BFD_RELOC_16_PCREL_S2); +- + /* At this point, fx_addnumber is "symbol offset - pcrel address". + Relocations want only the symbol offset. */ + reloc->addend = fixp->fx_addnumber + reloc->address; +@@ -13588,6 +13584,34 @@ } code = fixp->fx_r_type; @@ -181,8 +154,8 @@ diff -u -r1.263 tc-mips.c + } + } - /* To support a PC relative reloc, we used a Cygnus extension. - We check for that here to make sure that we don't let such a + reloc->howto = bfd_reloc_type_lookup (stdoutput, code); + if (reloc->howto == NULL) Index: gas/config/tc-mips.h =================================================================== RCS file: /cvsroot/gcc/src-cvs/src/gas/config/tc-mips.h,v