diff options
Diffstat (limited to 'opcodes/riscv-dis.c')
-rw-r--r-- | opcodes/riscv-dis.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index c341a0f..277b8fd 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -37,6 +37,9 @@ disassemble_info::fprintf_func which is for unstyled output. */ #define fprintf_func please_use_fprintf_styled_func_instead +/* The earliest privilege spec supported by disassembler. */ +#define PRIV_SPEC_EARLIEST PRIV_SPEC_CLASS_1P10 + struct riscv_private_data { bfd_vma gp; @@ -66,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; }; @@ -80,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). */ @@ -139,7 +143,7 @@ parse_riscv_dis_option (const char *option, struct disassemble_info *info) const char *name = NULL; RISCV_GET_PRIV_SPEC_CLASS (value, priv_spec); - if (priv_spec == PRIV_SPEC_CLASS_NONE) + if (priv_spec < PRIV_SPEC_EARLIEST) opcodes_error_handler (_("unknown privileged spec set by %s=%s"), option, value); else if (pd->default_priv_spec == PRIV_SPEC_CLASS_NONE) @@ -1577,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 }, @@ -1608,12 +1615,12 @@ disassembler_options_riscv (void) args = XNEWVEC (disasm_option_arg_t, num_args + 1); args[RISCV_OPTION_ARG_PRIV_SPEC].name = "SPEC"; - priv_spec_count = PRIV_SPEC_CLASS_DRAFT - PRIV_SPEC_CLASS_NONE - 1; + priv_spec_count = PRIV_SPEC_CLASS_DRAFT - PRIV_SPEC_EARLIEST; args[RISCV_OPTION_ARG_PRIV_SPEC].values = XNEWVEC (const char *, priv_spec_count + 1); for (i = 0; i < priv_spec_count; i++) args[RISCV_OPTION_ARG_PRIV_SPEC].values[i] - = riscv_priv_specs[i].name; + = riscv_priv_specs[PRIV_SPEC_EARLIEST - PRIV_SPEC_CLASS_NONE - 1 + i].name; /* The array we return must be NULL terminated. */ args[RISCV_OPTION_ARG_PRIV_SPEC].values[i] = NULL; |