[objdump Question] How to sort assembly code by each line number ?

Taeung Song treeze.taeung@gmail.com
Wed Feb 22 08:13:00 GMT 2017


Hi Nick,

I'm sorry for my tardy response.
Thank you so much !! for your detailed answer !

Thanks,
Taeung

On 02/21/2017 06:53 PM, Nick Clifton wrote:
> Hi Taeung,
>
>> If objdump has the option sorting assembly code according to line numbers,
>> I want to use the option.
>
> Sorry - objdump has no such option.
>
>> For example,
>> 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.
>
> Cheers
>   Nick
>
>



More information about the Binutils mailing list