]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
RISC-V: Add missing disassembler option `max`
authorMarek Pikuła <m.pikula@partner.samsung.com>
Tue, 1 Apr 2025 15:43:16 +0000 (17:43 +0200)
committerNelson Chu <nelson@rivosinc.com>
Tue, 15 Apr 2025 02:59:51 +0000 (10:59 +0800)
The flag already exists but it's not been exposed to user.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
binutils/doc/binutils.texi
opcodes/riscv-dis.c

index b291670fc6c819d5bcba7544be74ac698753b13f..c74526e929a7867cc0509e9e3e574c60c7d9f898 100644 (file)
@@ -2701,6 +2701,14 @@ but the result again may not be as you expect.
 For RISC-V, the following options are supported:
 
 @table @code
+@item max
+Disassemble without checking architecture string. This is a best effort mode, so
+for overlapping ISA extensions the first match (possibly incorrect in a given
+context) will be used to decode the instruction. It's useful, if the ELF file
+doesn't expose ISA string, preventing automatic ISA subset deduction, and the
+default fallback ISA string (@code{rv64gc}) doesn't cover all instructions in
+the binary.
+
 @item numeric
 Print numeric register names, rather than ABI names (e.g., print @code{x2}
 instead of @code{sp}).
index f862ef28a161accf9b0429e6a044f31ff85b2874..277b8fd473761c46ecb084d5d913bde89a0c51ba 100644 (file)
@@ -69,7 +69,7 @@ struct riscv_private_data
   const char (*riscv_fpr_names)[NRC];
   /* If set, disassemble as most general instruction.  */
   bool no_aliases;
-  /* If set, disassemble without checking architectire string, just like what
+  /* If set, disassemble without checking architecture string, just like what
      we did at the beginning.  */
   bool all_ext;
 };
@@ -83,6 +83,7 @@ set_default_riscv_dis_options (struct disassemble_info *info)
   pd->riscv_gpr_names = riscv_gpr_names_abi;
   pd->riscv_fpr_names = riscv_fpr_names_abi;
   pd->no_aliases = false;
+  pd->all_ext = false;
 }
 
 /* Parse RISC-V disassembler option (without arguments).  */
@@ -1580,6 +1581,9 @@ static struct
   riscv_option_arg_t arg;
 } riscv_options[] =
 {
+  { "max",
+    N_("Disassemble without checking architecture string."),
+    RISCV_OPTION_ARG_NONE },
   { "numeric",
     N_("Print numeric register names, rather than ABI names."),
     RISCV_OPTION_ARG_NONE },