diff -rcp --exclude='*.info*' binutils_reference/binutils-050218/gas/config/tc-mips.c binutils-050218/gas/config/tc-mips.c *** binutils_reference/binutils-050218/gas/config/tc-mips.c 2005-02-17 05:46:04.000000000 -0800 --- binutils-050218/gas/config/tc-mips.c 2005-02-25 18:46:55.277082758 -0800 *************** md_apply_fix3 (fixS *fixP, valueT *valP, *** 11018,11025 **** buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where); - assert (! fixP->fx_pcrel); - /* Don't treat parts of a composite relocation as done. There are two reasons for this: --- 11018,11023 ---- *************** md_apply_fix3 (fixS *fixP, valueT *valP, *** 11065,11071 **** case BFD_RELOC_MIPS16_GPREL: case BFD_RELOC_MIPS16_HI16: case BFD_RELOC_MIPS16_HI16_S: - assert (! fixP->fx_pcrel); /* Nothing needed to do. The value comes from the reloc entry */ break; --- 11063,11068 ---- *************** tc_gen_reloc (asection *section ATTRIBUT *** 12846,12853 **** *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; ! assert (! fixp->fx_pcrel); ! reloc->addend = fixp->fx_addnumber; /* Since the old MIPS ELF ABI uses Rel instead of Rela, encode the vtable entry to be used in the relocation's section offset. */ --- 12843,12865 ---- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; ! if (fixp->fx_pcrel) ! { ! if (OUTPUT_FLAVOR == bfd_target_elf_flavour) ! { ! /* At this point, fx_addnumber is "symbol offset - reloc->address". ! Relocations want only the symbol offset. */ ! reloc->addend = fixp->fx_addnumber + reloc->address; ! } ! else ! { ! /* A gruesome hack which is a result of the gruesome gas reloc ! handling. */ ! reloc->addend = reloc->address; ! } ! } ! else ! reloc->addend = fixp->fx_addnumber; /* Since the old MIPS ELF ABI uses Rel instead of Rela, encode the vtable entry to be used in the relocation's section offset. */ *************** tc_gen_reloc (asection *section ATTRIBUT *** 12858,12863 **** --- 12870,12885 ---- } code = fixp->fx_r_type; + if (fixp->fx_pcrel) + { + if (code == BFD_RELOC_32) + code = BFD_RELOC_32_PCREL; + else + as_bad_where (fixp->fx_file, fixp->fx_line, + _("Cannot make %s relocation PC relative"), + bfd_get_reloc_code_name (code)); + } + /* 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 Only in binutils-050218/gas/config: tc-mips.c~ diff -rcp --exclude='*.info*' binutils_reference/binutils-050218/gas/config/tc-mips.h binutils-050218/gas/config/tc-mips.h *** binutils_reference/binutils-050218/gas/config/tc-mips.h 2004-04-28 22:14:22.000000000 -0700 --- binutils-050218/gas/config/tc-mips.h 2005-02-25 15:52:23.000000000 -0800 *************** extern void mips_handle_align (struct fr *** 58,63 **** --- 58,68 ---- #define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2) + /* We permit PC relative difference expressions because gcc used to + generate them in .eh_frame sections. */ + #define DIFF_EXPR_OK + + /* Tell assembler that we have an itbl_mips.h header file to include. */ #define HAVE_ITBL_CPU Only in binutils-050218/gas/config: tc-mips.h~