Skip to content
Advertisement

how to disassebled binary with source line and file name using gcc-linaro-arm-linux-gnueabihf-objdump?

I want to get the disassebled binary files with source line and file name. I have added option -g as a compilation option,following is the setting in cmake files.

JavaScript

And following is my objdump bash script:

JavaScript

From the instructions, I should have a asm file with source line and file name just as https://manpages.debian.org/testing/binutils-arm-linux-gnueabihf/arm-linux-gnueabihf-objdump.1.en.html

it says:

–line-numbers Label the display (using debugging information) with the filename and source line numbers corresponding to the object code or relocs shown. Only useful with -d, -D, or -r.

However, I just got the file like the following:

JavaScript

THere are no source line and file name. In expectation, I want get the file like this:

JavaScript

Anyone can help me! thanks!

Advertisement

Answer

JavaScript

Try remove the -s switch, which strip away information. It works for me.

Advertisement