]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
MIPS16/GAS: Reject instructions that end with a dot
authorMaciej W. Rozycki <macro@orcam.me.uk>
Mon, 10 Feb 2025 22:11:25 +0000 (22:11 +0000)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Mon, 10 Feb 2025 22:11:25 +0000 (22:11 +0000)
commit04e94ec07306efebec091e8f2c9a0dfd7ea5613c
tree9f743474eb71248bd9743c2fb36cace74c0ab707
parent86fec8673dfcc4acba38f7ee6158a3ba72902a3b
MIPS16/GAS: Reject instructions that end with a dot

Fix a regression from commit 3fb49709438e ("MIPS16/GAS: Fix forced size
suffixes with argumentless instructions") and reject MIPS16 instructions
that end with a dot and no forced size suffix following, e.g.:

$ cat test.s
.set mips16
foo:
break.
entry.
addiu. $2, 0x7fff
addiu. $3, $2, 0
.align 8, 0
$ as -32 -o test.o test.s
$ objdump -d test.o

test.o:     file format elf32-tradbigmips

Disassembly of section .text:

00000000 <foo>:
   0: e805       break
   2: e809       entry
   4: f7ef 4a1f  addiu v0,32767
   8: 4260       addiu v1,v0,0
...
$

Add a test accordingly, also verifying invalid forced size suffixes.
gas/config/tc-mips.c
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/mips16-insn-length-bad.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-insn-length-bad.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-insn-length-bad.s [new file with mode: 0644]