aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2007-10-16 02:26:30 +0000
committerPeter Bergner <bergner@vnet.ibm.com>2007-10-16 02:26:30 +0000
commit8dbcd839b1bbad39586246ca2d444822b5f91ad7 (patch)
treedd111c6f35b5d11ca6ae324f4e894c6d6ff566fb /gas/config
parent1b64748beda63e896f48cb4c9409d8629db10747 (diff)
downloadgdb-8dbcd839b1bbad39586246ca2d444822b5f91ad7.zip
gdb-8dbcd839b1bbad39586246ca2d444822b5f91ad7.tar.gz
gdb-8dbcd839b1bbad39586246ca2d444822b5f91ad7.tar.bz2
gas/
* config/tc-ppc.c (ppc_setup_opcodes): Verify instructions are sorted according to major opcode number. opcodes/ * ppc-opc.c (TE): Correct signedness. (powerpc_opcodes): Sort psq_st and psq_stu according to major opcode number.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-ppc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 868258f..fc8b9a07 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -1249,6 +1249,7 @@ ppc_setup_opcodes (void)
const struct powerpc_macro *macro;
const struct powerpc_macro *macro_end;
bfd_boolean bad_insn = FALSE;
+ unsigned long prev_opcode = 0;
if (ppc_hash != NULL)
hash_die (ppc_hash);
@@ -1296,6 +1297,17 @@ ppc_setup_opcodes (void)
{
const unsigned char *o;
unsigned long omask = op->mask;
+ unsigned long major_opcode = PPC_OP (op->opcode);
+
+ /* The major opcodes had better be sorted. Code in the disassembler
+ assumes the insns are sorted according to major opcode. */
+ if (major_opcode < prev_opcode)
+ {
+ as_bad (_("major opcode is not sorted for %s"),
+ op->name);
+ bad_insn = TRUE;
+ }
+ prev_opcode = major_opcode;
/* The mask had better not trim off opcode bits. */
if ((op->opcode & omask) != op->opcode)