binutils Newspaper
JUNE 15, 2026
risc-v Ready to Land

RISC-V: riscv_parse_subset_t's isa_spec is only parser input

Makes the `isa_spec` field in `riscv_parse_subset_t` const to clarify that it's an input-only value for parsing RISC-V ISA subsets.

This patch modifies the riscv_parse_subset_t structure to make the isa_spec field a pointer to a const enum riscv_spec_class. This change clarifies that the isa_spec field is only used as input during parsing and is not modified. The patch also removes an unnecessary indirection in riscv_get_default_ext_version(). Reviewers have approved the patch.

In Details

The riscv_parse_subset_t structure is used when parsing RISC-V ISA subset strings. The isa_spec field indicates the specification class (e.g., draft, ratified). This patch changes bfd/elfxx-riscv.h and bfd/elfxx-riscv.c to reflect that isa_spec is an immutable input.

For Context

When processing computer programs, parsing is the process of analyzing a string of text, either in natural language or in a computer language, to determine its logical structure. In binutils, parsing is used to understand command-line options and other inputs. This patch changes an internal data structure related to parsing RISC-V instruction set architecture (ISA) subsets to clearly indicate that a field should not be modified during the parsing process, improving code clarity and preventing potential errors.

Filed Under: risc-vparsingISAcode clarityconst correctness