aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2022-09-22 12:40:43 +0100
committerNick Clifton <nickc@redhat.com>2022-09-22 12:40:43 +0100
commit3b8e069a3691adc1a93ca7f4bcb5e8e687317108 (patch)
treedd1be1490c128a72eb4cc565e02939036f76f6f1
parentd9fa9b7c3306008ee97140a3aafc56999d8cd2cd (diff)
downloadfsf-binutils-gdb-3b8e069a3691adc1a93ca7f4bcb5e8e687317108.zip
fsf-binutils-gdb-3b8e069a3691adc1a93ca7f4bcb5e8e687317108.tar.gz
fsf-binutils-gdb-3b8e069a3691adc1a93ca7f4bcb5e8e687317108.tar.bz2
opcodes: SH fix bank register disassemble.
* sh-dis.c (print_insn_sh): Enforce bit7 of LDC Rm,Rn_BANK and STC Rm_BANK,Rn is always 1.
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/sh-dis.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 1a23be8..bbd3544 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2022-09-22 Yoshinori Sato <ysato@users.sourceforge.jp>
+
+ * sh-dis.c (print_insn_sh): Enforce bit7 of LDC Rm,Rn_BANK and STC
+ Rm_BANK,Rn is always 1.
+
2022-07-21 Peter Bergner <bergner@linux.ibm.com>
* ppc-opc.c (XACC_MASK, XX3ACC_MASK): New defines.
diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c
index 0e46cb6..49dbc23 100644
--- a/opcodes/sh-dis.c
+++ b/opcodes/sh-dis.c
@@ -645,6 +645,8 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
rm = (nibs[n] & 0x3);
break;
case REG_B:
+ if (!(nibs[n] & 0x08)) /* Must always be 1. */
+ goto fail;
rb = nibs[n] & 0x07;
break;
case SDT_REG_N: