This is the mail archive of the
mailing list for the binutils project.
Re: [objdump Question] How to sort assembly code by each line number ?
I'm sorry for my tardy response.
Thank you so much !! for your detailed answer !
On 02/21/2017 06:53 PM, Nick Clifton wrote:
If objdump has the option sorting assembly code according to line numbers,
I want to use the option.
Sorry - objdump has no such option.
I want to sort the below output.
(especially parts of assembly code of line number 34)
The problem is that the same line of source code can appear in lots of places
in the assembler (for example because of macros, inline functions, templates, etc).
Plus compiler optimizations like loop unrolling can replicate the same line
of source code multiple times in the assembler output. So there really is no
easy way to produce *meaningful* disassembly sorted by line number.
If there isn't the option for it, I'd manually parse the output from 'objdump -dl'..
You can of course write a script to perform this sorting for you, so that you
do not have to do it by hand every time.