LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Query regarding objdump -S (https://www.linuxquestions.org/questions/programming-9/query-regarding-objdump-s-4175411446/)

ankitm 06-14-2012 09:52 AM

Query regarding objdump -S
 
Hi,

From objdump --help

-S, --source Intermix source code with disassembly

When I tried to run objdump -S libc-2.3.6.so , output didn't had the source code.

Can we interpret that libc-2.3.6.so was not complied with -g option ?

or there may be some other reason for this behaviour

Please suggest ..

neonsignal 06-14-2012 09:09 PM

It is not uncommon for the libraries to have the debug information kept in a separate package, and for the source code to be separate again.

For example, on Debian, to show the source code for libc, first get the debug information and the source code:
Code:

apt-get install libc6-dbg
cd /usr/src/; apt-get source libc6

When using objdump, the dumper needs to know where the source is (using '--prefix'):
Code:

objdump --prefix=/usr/src/ --prefix-strip=2 -S /lib/libc.so.6


All times are GMT -5. The time now is 10:51 AM.