From: Marek Pikuła Date: Thu, 27 Mar 2025 14:09:15 +0000 (+0100) Subject: RISC-V: Don't show support for 1.9.1 priv spec X-Git-Tag: binutils-2_45~1037 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d1f4362682f0c3be74f8d8d8e097e9c4a4d04f2;p=thirdparty%2Fbinutils-gdb.git RISC-V: Don't show support for 1.9.1 priv spec The privileged spec 1.9.1 support was removed since binutils 2.43. The linker only recognizes it and then reports a warning that it may conflict with other spec versions. While the support is removed, binutils should still recognize it, but it shouldn't be exposed to the user in `disassember-options` help. Signed-off-by: Marek Pikuła --- diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index c341a0fe317..f862ef28a16 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; @@ -139,7 +142,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) @@ -1608,12 +1611,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;