aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-10 15:06:43 +0930
committerAlan Modra <amodra@gmail.com>2020-08-10 21:52:17 +0930
commit86c0f617ac5f3a5f4aab76c7f90255254ca27576 (patch)
tree9436604483d24f1f57d44f9cbe7652958d8eba37 /gas/config/tc-ppc.c
parent9b0ac51b22d0cf900f39e17e615bb22e32720f6e (diff)
downloadgdb-86c0f617ac5f3a5f4aab76c7f90255254ca27576.zip
gdb-86c0f617ac5f3a5f4aab76c7f90255254ca27576.tar.gz
gdb-86c0f617ac5f3a5f4aab76c7f90255254ca27576.tar.bz2
Error on lmw, lswi and related PowerPC insns when LE
* config/tc-ppc.c (md_assemble): Error for lmw, stmw, lswi, lswx, stswi, or stswx in little-endian mode. * testsuite/gas/ppc/476.d, * testsuite/gas/ppc/476.s: Delete lmw, stmw, lswi, lswx, stswi, stswx. * testsuite/gas/ppc/a2.d, * testsuite/gas/ppc/a2.s: Move lmw, stmw, lswi, lswx, stswi, stswx.. * testsuite/gas/ppc/be.d, * testsuite/gas/ppc/be.s: ..to here, new big-endian only test. * testsuite/gas/ppc/le_error.d, * testsuite/gas/ppc/le_error.l: New little-endian test. * testsuite/gas/ppc/ppc.exp: Run new tests.
Diffstat (limited to 'gas/config/tc-ppc.c')
-rw-r--r--gas/config/tc-ppc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 1000b61..abe5a8f 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -3176,6 +3176,15 @@ md_assemble (char *str)
}
insn = opcode->opcode;
+ if (!target_big_endian
+ && ((insn & ~(1 << 26)) == 46u << 26
+ || (insn & ~(0xc0 << 1)) == (31u << 26 | 533 << 1)))
+ {
+ /* lmw, stmw, lswi, lswx, stswi, stswx */
+ as_bad (_("`%s' invalid when little-endian"), str);
+ ppc_clear_labels ();
+ return;
+ }
str = s;
while (ISSPACE (*str))