aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-06-21 16:01:27 +0100
committerMaciej W. Rozycki <macro@imgtec.com>2016-06-21 18:05:18 +0100
commit912815f079a8f3c40c0968ba5140619de079e199 (patch)
tree098bd436e09913e92c8add39db353611248f38b2 /gas/config/tc-mips.c
parent5f68df25f869d74f0235276a81536392fd376e6d (diff)
downloadgdb-912815f079a8f3c40c0968ba5140619de079e199.zip
gdb-912815f079a8f3c40c0968ba5140619de079e199.tar.gz
gdb-912815f079a8f3c40c0968ba5140619de079e199.tar.bz2
MIPS/GAS: Use the module level ISA setting for R6 relaxation
Use the module level ISA setting rather than the last ISA selected with a `.set' directive in the source file in determination as to whether to keep PC-relative relocations and then with the original symbol referred, for the purpose of R6 linker relaxation. This is so that with e.g. code like this: b foo .set mips32r2 ... it's the command line options or any `.module' directive that decides how to encode any relocation for `foo' rather than the presence of `.set mips32r2'. gas/ * config/tc-mips.c (mips_force_relocation): Use `file_mips_opts' rather than `mips_opts' for the R6 ISA check. (mips_fix_adjustable): Likewise. * testsuite/gas/mips/pcrel-reloc-1.d: New test. * testsuite/gas/mips/pcrel-reloc-1-r6.d: New test. * testsuite/gas/mips/pcrel-reloc-2.d: New test. * testsuite/gas/mips/pcrel-reloc-2-r6.d: New test. * testsuite/gas/mips/pcrel-reloc-3.d: New test. * testsuite/gas/mips/pcrel-reloc-3-r6.d: New test. * testsuite/gas/mips/pcrel-reloc-1.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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 1a472a3..ed64b68 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -14768,7 +14768,7 @@ mips_force_relocation (fixS *fixp)
return 1;
/* We want all PC-relative relocations to be kept for R6 relaxation. */
- if (ISA_IS_R6 (mips_opts.isa)
+ if (ISA_IS_R6 (file_mips_opts.isa)
&& (fixp->fx_r_type == BFD_RELOC_16_PCREL_S2
|| fixp->fx_r_type == BFD_RELOC_MIPS_21_PCREL_S2
|| fixp->fx_r_type == BFD_RELOC_MIPS_26_PCREL_S2
@@ -17137,7 +17137,7 @@ mips_fix_adjustable (fixS *fixp)
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 (limited_pcrel_reloc_p (fixp->fx_r_type)
- && (HAVE_IN_PLACE_ADDENDS || ISA_IS_R6 (mips_opts.isa)))
+ && (HAVE_IN_PLACE_ADDENDS || ISA_IS_R6 (file_mips_opts.isa)))
return 0;
/* R_MIPS16_26 relocations against non-MIPS16 functions might resolve