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

RISC-V: drop dead code from subset parsing

Removes dead code and simplifies error handling in RISC-V subset parsing.

This patch removes redundant checks and simplifies error handling in the RISC-V subset parsing logic. Specifically, it removes unnecessary checks for NULL return values from riscv_parsing_subset_version() and simplifies the error message construction in riscv_update_subset1(). These changes improve code clarity and maintainability.

In the Thread 1 participant
  1. Jiawei contributor

    Agrees with the patch, which drops dead code and clarifies error handling.

    “In riscv_update_subset1(), when explicit_subset is NULL, errmsg_internal is the empty string. There's no need then to pass this as an extra argument to the error handler.”

In Details

This patch focuses on the RISC-V subset parsing logic, which is used to interpret the ISA extensions specified in the object file. Removing dead code and simplifying error handling improves the maintainability of the binutils.

For Context

This patch cleans up the code responsible for interpreting the specific features enabled in a RISC-V program. RISC-V is a modular architecture where different extensions can be added to the base instruction set. This patch removes unnecessary parts of the code and makes the error handling more straightforward, making the code easier to understand and maintain.

Filed Under: binutilsrisc-vsubset parsingdead codeerror handling