RFC: Annotate immediates in x86 disassembly

Jan Beulich jbeulich@suse.com
Sun May 3 08:39:43 GMT 2026


On 23.04.2026 13:03, Nick Clifton wrote:
> Hi Guys,
> 
>   Attached is a v2 of the proposed patch.  It adds:
> 
>   * The annotation is displayed as a comment at the end of the line.
>   * The symbol name is displayed in dis_style_symbol rather than dis_style_address.
>   * Shared object files (type ET_DYN) can also benefit from the new feature.
> 
>   There are a couple of potential issues with the patch:
> 
>   * It adds a new buffer to the instr_info structure, making it even bigger.
>   * There are opportunities for sharing code with the oappend_*() functions
>     which I did not take.  (Mainly to keep the code in the patch simple).
>   * There are opportunities for other places in the dissaembler to add comments
>     of their own, but I figured that these could be added later, if they
>     were actually deemed worthwhile.
> 
>   Thoughts, comments ?

Already when reading Michael's v1 comment I wondered: How's handling of
multiple comments going to work? Surely we want to switch the present
%rip-relative operand printing to the new cappend_*() model. Hence both
that and an immediate may want to have a comment added. Presumably those
would want to appear in the same order as the operands, which are
printed in different order for AT&T vs Intel syntax.

Jan


More information about the Binutils mailing list