aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2011-02-28 15:44:53 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2011-02-28 15:44:53 +0000
commitce70d90a3e5e00fd49b46164a43e3dfbcf1cf404 (patch)
tree3fa69a6e9d73d3806e9892bba1a4cd515edbef7e /gas/config
parent5c4f07bae108d3f6e70b755f49d1c008088138f9 (diff)
downloadbinutils-ce70d90a3e5e00fd49b46164a43e3dfbcf1cf404.zip
binutils-ce70d90a3e5e00fd49b46164a43e3dfbcf1cf404.tar.gz
binutils-ce70d90a3e5e00fd49b46164a43e3dfbcf1cf404.tar.bz2
gas/
* config/tc-mips.c (mips_fix_adjustable): On REL targets also reject PC-relative relocations. gas/testsuite/ * gas/mips/branch-misc-2.d: Adjust for relocation change. * gas/mips/branch-misc-2pic.d: Likewise. * gas/mips/branch-misc-4.d: New test for PC-relative relocation overflow. * gas/mips/branch-misc-4-64.d: Likewise. * gas/mips/branch-misc-4.s: Source for the new tests. * testsuite/gas/mips/mips.exp: Run the new tests.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-mips.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 4b7dcdc..897ed0f 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -14248,8 +14248,12 @@ mips_fix_adjustable (fixS *fixp)
&& (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE) != 0)
return 0;
- /* There is no place to store an in-place offset for JALR relocations. */
- if (fixp->fx_r_type == BFD_RELOC_MIPS_JALR && HAVE_IN_PLACE_ADDENDS)
+ /* There is no place to store an in-place offset for JALR relocations.
+ Likewise an in-range offset of PC-relative relocations may overflow
+ the in-place relocatable field if recalculated against the start
+ address of the symbol's containing section. */
+ if (HAVE_IN_PLACE_ADDENDS
+ && (fixp->fx_pcrel || fixp->fx_r_type == BFD_RELOC_MIPS_JALR))
return 0;
#ifdef OBJ_ELF