This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
objdump -S omits source when input uses .gnu_debuglink
- From: Noah Misch <noah at cs dot caltech dot edu>
- To: binutils at sourceware dot org
- Date: Fri, 8 Jun 2007 14:02:21 -0700
- Subject: objdump -S omits source when input uses .gnu_debuglink
Hi all,
When an object's debugging information resides in a separate file, linked via a
.gnu_debuglink section, `objdump -S' does not show source code; the output is
rigorously identical to that of `objdump -d'. The following command sequence
illustrates the problem:
echo 'int main() { return 0; }' >foo.c
gcc -g foo.c -o foo
objcopy --strip-debug --add-gnu-debuglink=foo foo foo-link
objdump -S foo | sed -n '/<main>/,/^$/p'
objdump -S foo-link | sed -n '/<main>/,/^$/p'
The gdb `list' command reads source from both objects without trouble.
CVS exhibits the problem, as do older versions.
Thanks.