I'm struggling with understanding the jumps shown by objdump
, taking into consideration that it should be diff
-friendly.
Use --visualize-jumps
This is pretty nice and clear for the jumps. However, it works well only when looking at a single listing. If I have two listings (like before and after the change) and compare them with diff
, the extra markers visualizing jumps break the diff view a lot.
Use --line-numbers
I'm not able to tell how would this work because it is in my case so long that I never waited long enough to see the results.
Count by hand
I'm seeing cases like:
ja <symbol+offset>
with the offset
part being - I presume - hex offset in bytes from the start of the symbol
.
So, I could not use --no-addresses
and then each line starts with the address, subtracting the address of the first line I can see where the jump leads. However, this again breaks diff
view since two builds may have different base addresses of the same symbol. (And even if they luckily wouldn't for larger changes this may still alter what diff
shows.)
(For the record, I could also use --show-raw-insn
and count bytes per line. But I'm afraid this would still break diff
view in many cases while making the counting much more difficult.)
What I would prefer
If the offset
part could be shown as a line number in the listing.
Or at least if I could rebase the symbol to a given address (preferably 0
of course) to mitigate different bases between different builds. (But I expect this would still mess with the diff
view in case of larger differences.)
I guess the approach with no --no-addresses
described above could be automated with a reasonable effort. But if so, maybe there is tooling that already does so. Or a set of switches to objdump
that I just fail to see.