MIPS/GAS: Use the module level ISA setting for R6 relaxation
authorMaciej W. Rozycki <macro@imgtec.com>
Tue, 21 Jun 2016 15:01:27 +0000 (16:01 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Tue, 21 Jun 2016 17:05:18 +0000 (18:05 +0100)
commit912815f079a8f3c40c0968ba5140619de079e199
tree098bd436e09913e92c8add39db353611248f38b2
parent5f68df25f869d74f0235276a81536392fd376e6d
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.
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/pcrel-reloc-1-r6.d [new file with mode: 0644]
gas/testsuite/gas/mips/pcrel-reloc-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/pcrel-reloc-1.s [new file with mode: 0644]
gas/testsuite/gas/mips/pcrel-reloc-2-r6.d [new file with mode: 0644]
gas/testsuite/gas/mips/pcrel-reloc-2.d [new file with mode: 0644]
gas/testsuite/gas/mips/pcrel-reloc-3-r6.d [new file with mode: 0644]
gas/testsuite/gas/mips/pcrel-reloc-3.d [new file with mode: 0644]