Re: [PATCH v4 00/28] objtool: Function validation tracing

From: David Laight
Date: Mon Nov 17 2025 - 07:40:04 EST


On Mon, 17 Nov 2025 10:47:06 +0100
Alexandre Chartre <alexandre.chartre@xxxxxxxxxx> wrote:

> On 11/17/25 10:42, David Laight wrote:
...
> > Although I think there ought to be some indication of the 31 NOP bytes
> > at the end of the middle alternative.
>
> I am now compacting the code by removing all trailing NOPs. I should probably
> improve that with printing the actual number of NOPs, for example NOP31 (or nop31)

That is the sort of thing I was thinking of.
Perhaps the actual opcodes on one line - eg: NOP5; NOP5; NOP5; NOP1

> > I'd also decode those callq as 'callq .+6' - not sure what other people think?
> > It is rather specific to that code.
>
> This is done by libopcodes. I will need to check if there is an option to display
> the branch distance instead of the branch target.

The 'problem' is that mostly you want the branch target - except when it is small.
Then you don't need both 'address' and 'symbol+offset', and it is quicker to find
the target by looking at the branch distance.
I'm not sure how you'd please everyone :-)

I'm sure one of the disassemblers ends up giving you the target address in a form
that isn't on the instruction line!
I've definitely counted opcode bytes to find the target.

David