]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gas/testsuite/gas/mips/mips.exp
MIPS16/GAS: Fix absolute references with PC-relative synthetic instructions
authorMaciej W. Rozycki <macro@imgtec.com>
Tue, 2 May 2017 23:05:15 +0000 (00:05 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Tue, 2 May 2017 23:15:56 +0000 (00:15 +0100)
commit82d808edbc7a06f706b82064cec6c3ed88f0c4be
tree6510e8c35632eba734ed8508067ca9f98f625fc8
parent3d8505928a06e00b05bb162c1ad0dd612c1c16af
MIPS16/GAS: Fix absolute references with PC-relative synthetic instructions

Complement commit 88a7ef168927 ("MIPS16/GAS: Restore unsupported
relocation diagnostics") and also propagate constant expressions, either
already reduced from absolute symbol references or created from literals
in the first place, used as a PC-relative operand with the MIPS16 LA,
LW, DLA and LD synthetic instructions to relaxation, matching the way
forward absolute symbol references have been handled as from the commit
referred and letting relaxation produce any necessary relocations, if
possible, for the absolute value requested to be reproduced at the run
time.

Call `symbol_append' for any expression symbol created for the purpose
of MIPS16 relaxation as with constant expressions now propagated from
earlier on such symbols may make it through and have R_MIPS16_PC16_S1
relocations emitted against, and therefore need to appear in the symbol
table produced.

gas/
* config/tc-mips.c (append_insn): Call `symbol_append' for any
expression symbol created for MIPS16 relaxation.
(match_mips16_insn): Don't encode a constant value as an
immediate with a PC-relative operand.

* testsuite/gas/mips/mips16-pcrel-absolute-1.d: New test.
* testsuite/gas/mips/mips16-branch-absolute-1.d: New test.
* testsuite/gas/mips/mips16-branch-absolute-2.d: New test.
* testsuite/gas/mips/mips16-branch-absolute-addend-1.d: New
test.
* testsuite/gas/mips/mips16-branch-absolute-n32-1.d: New test.
* testsuite/gas/mips/mips16-branch-absolute-n32-2.d: New test.
* testsuite/gas/mips/mips16-branch-absolute-addend-n32-1.d: New
test.
* testsuite/gas/mips/mips16-branch-absolute-n64-1.d: New test.
* testsuite/gas/mips/mips16-branch-absolute-n64-2.d: New test.
* testsuite/gas/mips/mips16-branch-absolute-addend-n64-1.d: New
test.
* testsuite/gas/mips/mips16-pcrel-absolute-1.l: New stderr
output.
* testsuite/gas/mips/mips16-pcrel-absolute-1.s: New test source.
* testsuite/gas/mips/mips16-branch-absolute-1.s: New test
source.
* testsuite/gas/mips/mips16-branch-absolute-2.s: New test
source.
* testsuite/gas/mips/mips16-branch-absolute-addend-1.s: New test
source.
* testsuite/gas/mips/mips.exp: Run the new tests.

ld/
* testsuite/ld-mips-elf/mips16-branch-absolute-1.d: New test.
* testsuite/ld-mips-elf/mips16-branch-absolute-2.d: New test.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend-1.d: New
test.
* testsuite/ld-mips-elf/mips16-branch-absolute-n32-1.d: New
test.
* testsuite/ld-mips-elf/mips16-branch-absolute-n32-2.d: New
test.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend-n32-1.d:
New test.
* testsuite/ld-mips-elf/mips16-branch-absolute-n64-1.d: New
test.
* testsuite/ld-mips-elf/mips16-branch-absolute-n64-2.d: New
test.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend-n64-1.d:
New test.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
29 files changed:
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/mips16-branch-absolute-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-1.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-2.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-addend-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-addend-1.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-addend-n32-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-addend-n64-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-n32-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-n32-2.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-n64-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-absolute-n64-2.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-pcrel-absolute-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-pcrel-absolute-1.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-pcrel-absolute-1.s [new file with mode: 0644]
ld/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/mips16-branch-absolute-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-branch-absolute-2.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-branch-absolute-addend-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-branch-absolute-addend-n32-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-branch-absolute-addend-n64-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-branch-absolute-n32-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-branch-absolute-n32-2.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-branch-absolute-n64-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-branch-absolute-n64-2.d [new file with mode: 0644]