* elf32-mips.c (mips_elf_calculate_relocation): Fix overflow handling
authorThiemo Seufer <ths@networkno.de>
Fri, 7 Sep 2001 05:00:37 +0000 (05:00 +0000)
committerThiemo Seufer <ths@networkno.de>
Fri, 7 Sep 2001 05:00:37 +0000 (05:00 +0000)
commitcb56d3d327dc7fd17dbc3e3f95131cb6b312f18e
tree35b652e23a7ce84c43b26d953323437cd503d94d
parentc0a1a2e89b45a2eff4279723544ed4fd69d5cbdf
* elf32-mips.c (mips_elf_calculate_relocation): Fix overflow handling
of R_MIPS_PC16.

* config/tc-mips.c (append_insn): Handle BFD_RELOC_16_PCREL.
(macro_build): Use BFD_RELOC_16_PCREL_S2 only for embedded
PIC, BFD_RELOC_16_PCREL for the rest.
(mips_ip): Likewise.
        (md_pcrel_from): return the right offset for the differently shifted
        pcrel relocs.
(md_apply_fix): Handle BFD_RELOC_16_PCREL.

* gas/mips/beq.d: Check branches to external labels.
* gas/mips/beq.s: Likewise.
* gas/mips/bge.d: Likewise.
* gas/mips/bge.s: Likewise.
* gas/mips/bgeu.d: Likewise.
* gas/mips/bgeu.s: Likewise.
* gas/mips/blt.d: Likewise.
* gas/mips/blt.s: Likewise.
* gas/mips/bltu.d: Likewise.
* gas/mips/bltu.s: Likewise.
* gas/mips/elempic.d: Switch from R_MIPS_GNU_REL16_S2 to R_MIPS_PC16.
* gas/mips/empic.d: Likewise.
* gas/mips/empic.s: Likewise.
* gas/mips/telempic.d: Likewise.
* gas/mips/tempic.d: Likewise.
15 files changed:
bfd/ChangeLog
bfd/elf32-mips.c
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/ChangeLog
gas/testsuite/gas/mips/beq.d
gas/testsuite/gas/mips/beq.s
gas/testsuite/gas/mips/bge.d
gas/testsuite/gas/mips/bge.s
gas/testsuite/gas/mips/bgeu.d
gas/testsuite/gas/mips/bgeu.s
gas/testsuite/gas/mips/blt.d
gas/testsuite/gas/mips/blt.s
gas/testsuite/gas/mips/bltu.d
gas/testsuite/gas/mips/bltu.s