[PATCH 1/1] riscv: Add missing disassembler option `max`
Marek Pikula
m.pikula@partner.samsung.com
Tue Mar 25 19:54:33 GMT 2025
On 25.03.2025 15:37, Jan Beulich wrote:
> On 25.03.2025 15:21, Marek Pikula wrote:
>> On 25.03.2025 15:07, Jan Beulich wrote:
>>> Before something like this is exposed, shouldn't it first be defined what
>>> "maximum" here actually means? Even standard extensions already overlap,
>>> so there isn't an obvious "disassemble everything we know of".
>> As far as I understand the current behaviour, the disassembler uses the
>> first match it can find, so in a way it'sa best effort mode.
> The first match it can find that also satisfies the presently enabled ISA
> extensions, aiui. That extra constraint is what I understand you want to
> suppress with the "max" option. Am I somehow mistaken there?
Current behaviour is the following (without the `max` flag):
1. Check if the current ELF has a section with ISA string, and use it
for disassembly.
2. Otherwise, use the default `rv64gc` (in `default_arch`).
With `max` flag it basically ignores the aforementioned restrictions on
instruction matching. I've also sent a patch to enable user to specify
the `default_arch` explicitly
(https://sourceware.org/pipermail/binutils/2025-March/140177.html).
>> Maybe
>> providing this information in the `riscv_options` description would be
>> enough?
>>> Furthermore I think such an addition would want to come with a doc
>>> adjustment as well. Sadly RISC-V's -M options look to be entirely
>>> undocumented at this point. Yet as per above clarifying to the user what
>>> to expect is quite relevant here.
>> For me, in terms of documentation, it's enough to see the descriptions
>> present in `riscv_options` (and thus with `show disassembler-options`
>> GDB command), but indeed it was hard to find at first. I don't think
>> that extending documentation is in scope of this patch, but if you wish,
>> I could work on extending the documentation if you point me where such a
>> change should happen.
> That's binutils/doc/binutils.texi. Adding documentation is always in scope
> of adding a new command line (sub)option. What's not in scope here is the
> previously missing documentation on pre-existing -M options. That's perhaps
> more of a request to the RISC-V maintainers (who sadly you didn't even Cc;
> no added).
Ok, I'll add some documentation for all of the supported flags. Here is
the patch: https://sourceware.org/pipermail/binutils/2025-March/140185.html
Once it gets accepted, I'll modify this patch to include the documentation.
Thank you for adding RISC-V maintainers. I didn't notice that there is a
separate MAINTAINERS file for binutils, sorry for that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20250325/ad9e4a96/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 22957 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250325/ad9e4a96/attachment-0001.png>
More information about the Binutils
mailing list