How does objdump manage to display source code? Is there a reference to the source file in the binary? I tried running strings on the binary and couldn't find any reference to the source file listed...
Thanks.
How does objdump manage to display source code? Is there a reference to the source file in the binary? I tried running strings on the binary and couldn't find any reference to the source file listed...
Thanks.
The following article may be helpful: Understanding ELF using readelf and objdump.
It does not display source code, it displays the disassembly of the binary. There is a 1-1 mapping between the binary and the assembly.
objdump
uses the DWARF debugging information compiled into the binary, which references the source file name. If the binary isn't compiled with debugging information, or objdump
can't find the source file, then you don't get source code in your output - only assembly.
You don't see the source file name when you use strings
on the binary, because DWARF uses compression.