From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hsmtpd-def.xspmail.jp (hsmtpd-def.xspmail.jp [202.238.198.239]) by sourceware.org (Postfix) with ESMTPS id E95633858D1E for ; Wed, 14 Sep 2022 02:44:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E95633858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=users.sourceforge.jp X-Country-Code: JP Received: from sakura.ysato.name (ik1-413-38519.vs.sakura.ne.jp [153.127.30.23]) by hsmtpd-out-2.asahinet.cluster.xspmail.jp (Halon) with ESMTPA id 328d1613-b3b1-46d0-8065-8a2426b36282; Wed, 14 Sep 2022 11:44:21 +0900 (JST) Received: from SIOS1075.flets-east.jp (al142138.dynamic.ppp.asahi-net.or.jp [111.234.142.138]) by sakura.ysato.name (Postfix) with ESMTPSA id BDCD01C00A0; Wed, 14 Sep 2022 11:44:20 +0900 (JST) From: Yoshinori Sato To: binutils@sourceware.org Cc: Yoshinori Sato Subject: [PATCH] opcodes: SH fix bank register disassemble. Date: Wed, 14 Sep 2022 11:44:04 +0900 Message-Id: <20220914024404.7204-1-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Bit7 of LDC Rm,Rn_BANK and STC Rm_BANK,Rn is always 1. Since it is not confirmed that this is 1 now, it was outputting incorrect code as a correct instruction. Signed-off-by: Yoshinori Sato --- opcodes/sh-dis.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c index 0e46cb6f4d9..6c8bd7b1cd7 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)) /* always 1*/ + goto fail; rb = nibs[n] & 0x07; break; case SDT_REG_N: -- 2.30.2