diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2016-12-23 12:37:40 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2016-12-23 20:35:03 +0000 |
commit | 48cabe0351a327a24491846027791916681fcff5 (patch) | |
tree | 7f51dc059706f38c5d60220222e91036f967a474 /opcodes | |
parent | ac388e3085d49661ea9b394992b16d8cc76dd8d3 (diff) | |
download | gdb-48cabe0351a327a24491846027791916681fcff5.zip gdb-48cabe0351a327a24491846027791916681fcff5.tar.gz gdb-48cabe0351a327a24491846027791916681fcff5.tar.bz2 |
MIPS16/GAS: Disallow EXTEND delay-slot scheduling
Do not allow any explicitly coded EXTEND instruction to be automatically
scheduled into a jump delay slot, as an EXTEND prefix is coupled with
the next regular MIPS16 instruction and therefore swapping it with a
jump would change program's semantics; EXTEND is not architecturally
allowed to be present in a jump delay slot anyway.
opcodes/
* mips16-opc.c (mips16_opcodes): Set NODS in `pinfo' for
"extend".
gas/
* testsuite/gas/mips/mips16-extend-swap.d: New test.
* testsuite/gas/mips/mips16-extend-swap.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new test.
(cherry picked from commit 645c455650ed35460afdacb078c7c58308607fbe)
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 5 | ||||
-rw-r--r-- | opcodes/mips16-opc.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 9938992..5166be4 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,10 @@ 2016-12-23 Maciej W. Rozycki <macro@imgtec.com> + * mips16-opc.c (mips16_opcodes): Set NODS in `pinfo' for + "extend". + +2016-12-23 Maciej W. Rozycki <macro@imgtec.com> + * mips-dis.c (set_default_mips_dis_options): Use HAVE_BFD_MIPS_ELF_GET_ABIFLAGS rather than BFD64 to guard the call to `bfd_mips_elf_get_abiflags'. diff --git a/opcodes/mips16-opc.c b/opcodes/mips16-opc.c index 758b78f..7d430dd 100644 --- a/opcodes/mips16-opc.c +++ b/opcodes/mips16-opc.c @@ -357,7 +357,7 @@ const struct mips_opcode mips16_opcodes[] = {"zew", "x", 0xe851, 0xf8ff, MOD_1, 0, I64, 0, 0 }, /* Place EXTEND last so that it catches any prefix that didn't match anything. */ -{"extend", "e", 0xf000, 0xf800, 0, 0, I1, 0, 0 }, +{"extend", "e", 0xf000, 0xf800, NODS, 0, I1, 0, 0 }, }; const int bfd_mips16_num_opcodes = |