binutils Newspaper
NOVEMBER 30, 2026
risc-v — Committed

RISC-V: add an "arch=" disassembler option

The patch adding an `arch=` option to the RISC-V disassembler has been committed after a minor nitpick.

This discussion confirms the commitment of a patch that adds an arch= option to the RISC-V disassembler. The committer, Kito Cheng, notes that a minor fix was applied before merging, specifically regarding the reset of two null pointers (arch_option and default_arch) within the disassemble_free_riscv function. This reset was deemed unnecessary as the memory would be freed later anyway. The patch is now in trunk.

In the Thread 1 participant
  1. Kito Cheng <kito.cheng@gmail.com> maintainer

    Confirms the commit of the RISC-V disassembler patch, mentioning a minor fix applied.

    “Thanks for this patch, committed to trunk with a minor nit fix, and it's minor enough so I just fix that and push, hope you don't mind :) nit: pd will free later so we don't need to reset those two pointers to NULL.”

In Details

The patch introduces a new command-line option, arch=, to binutils' RISC-V disassembler. This allows users to explicitly specify the target RISC-V architecture (e.g., RV32I, RV64GC) when disassembling code, ensuring that the disassembler interprets instructions correctly according to the specified ISA extension. The commit message indicates a minor cleanup related to freeing memory in disassemble_free_riscv.

For Context
RISC-V
An open-standard instruction set architecture (ISA) based on RISC principles, designed for simplicity and modularity.
disassembler
A program that translates machine code (binary instructions) back into a human-readable assembly language format.
ISA
Instruction Set Architecture. The vocabulary of commands understood by a CPU.
RV32I, RV64GC
Specific profiles of the RISC-V ISA. RV32I is the base integer instruction set for 32-bit, while RV64GC includes the base integer set, multiplication/division, atomics, floating-point, and compressed instructions for 64-bit.
trunk
The main development branch in a version control system, typically containing the latest committed code.
Filed Under: risc-vdisassembleroptioncommitted