From afdbd6d03b32209a99c57bfe2ee96e87a58a25bc Mon Sep 17 00:00:00 2001 From: Chris Demetriou Date: Thu, 1 Nov 2001 01:33:47 +0000 Subject: [ bfd/ChangeLog ] 2001-10-31 Chris Demetriou * elf32-mips.c (_bfd_mips_elf_hi16_reloc): Handle PC-relative relocations properly. [ gas/ChangeLog ] 2001-10-31 Chris Demetriou * config/tc-mips.c (HAVE_32BIT_ADDRESSES): If compiling embedded PIC code, assume pointers the same size as GPRs. (macro): In M_LA_AB handling for embedded PIC code, support "la $treg,foo-bar($breg)". In load/store handling (label ld_st) support " $treg,-($breg)" which is used by the compiler for switch statements. In load/store double multi-instruction macro handling (label ldd_std) add a comment that no special handling is currently done for embedded PIC. (mips_ip): In 'o' (16-bit offset) case, only accept 16 bit offsets. [ gas/testsuite/ChangeLog ] 2001-10-31 Chris Demetriou * gas/mips/empic.s: Undo damage inflicted on 2000-12-02. * gas/mips/empic.d: Likewise. * gas/mips/elempic.d: Likewise (it was copied into other files). * gas/mips/telempic.d: Likewise. * gas/mips/tempic.d: Likewise. * gas/mips/empic2.s: New test to check new 'la' and 'lw' (and related ops) syntax, test loads with large offsets. * gas/mips/emcic2.d: Likewise. * gas/mips/mips.exp: Run the new test on ELF platforms. --- bfd/elf32-mips.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bfd/elf32-mips.c') diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 38b0f8b..7fee3c5 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1190,6 +1190,8 @@ _bfd_mips_elf_hi16_reloc (abfd, relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; relocation += reloc_entry->addend; + if (reloc_entry->howto->pc_relative) + relocation -= reloc_entry->address; if (reloc_entry->address > input_section->_cooked_size) return bfd_reloc_outofrange; -- cgit v1.1