aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-06-13 16:52:42 +0100
committerMaciej W. Rozycki <macro@imgtec.com>2016-06-13 17:02:22 +0100
commit97f50151221de0a023a8317559b1992a90f9cb8f (patch)
tree59c7ceb3a61fb03e7d7471b3c69636b9c1c46b62 /gas/config/tc-mips.c
parent0c9663cbd41c27a8e20ca88a53ba3deae374f1d8 (diff)
downloadgdb-97f50151221de0a023a8317559b1992a90f9cb8f.zip
gdb-97f50151221de0a023a8317559b1992a90f9cb8f.tar.gz
gdb-97f50151221de0a023a8317559b1992a90f9cb8f.tar.bz2
MIPS/GAS: Don't convert RELA JALR relocations on R6
Revert an inadvertent change to make RELA JALR relocations section-relative on MIPS R6 targets made with commit 7361da2c952e ("Add support for MIPS R6."). There is no need to make this a special case and the comment introduced with the said change clearly indicates this was not intended. gas/ * config/tc-mips.c (mips_fix_adjustable): Don't convert RELA JALR relocations on R6. * testsuite/gas/mips/jal-svr4pic-local.d: New test. * testsuite/gas/mips/mips1@jal-svr4pic-local.d: New test. * testsuite/gas/mips/r3000@jal-svr4pic-local.d: New test. * testsuite/gas/mips/micromips@jal-svr4pic-local.d: New test. * testsuite/gas/mips/jal-svr4pic-local-n32.d: New test. * testsuite/gas/mips/micromips@jal-svr4pic-local-n32.d: New test. * testsuite/gas/mips/jal-svr4pic-local-n64.d: New test. * testsuite/gas/mips/micromips@jal-svr4pic-local-n64.d: New test. * testsuite/gas/mips/jal-svr4pic-local.s: New test source. * testsuite/gas/mips/jal-svr4pic-local-newabi.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 2e8be58..4022829 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -17126,16 +17126,18 @@ 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.
- Likewise an in-range offset of limited PC-relative relocations may
+ /* There is no place to store an in-place offset for JALR relocations. */
+ if (jalr_reloc_p (fixp->fx_r_type) && HAVE_IN_PLACE_ADDENDS)
+ return 0;
+
+ /* Likewise an in-range offset of limited PC-relative relocations may
overflow the in-place relocatable field if recalculated against the
start address of the symbol's containing section.
Also, PC relative relocations for MIPS R6 need to be symbol rather than
section relative to allow linker relaxations to be performed later on. */
- if ((HAVE_IN_PLACE_ADDENDS || ISA_IS_R6 (mips_opts.isa))
- && (limited_pcrel_reloc_p (fixp->fx_r_type)
- || jalr_reloc_p (fixp->fx_r_type)))
+ if (limited_pcrel_reloc_p (fixp->fx_r_type)
+ && (HAVE_IN_PLACE_ADDENDS || ISA_IS_R6 (mips_opts.isa)))
return 0;
/* R_MIPS16_26 relocations against non-MIPS16 functions might resolve