objdump -S omits source when input uses .gnu_debuglink
Noah Misch
noah@cs.caltech.edu
Fri Jun 8 21:02:00 GMT 2007
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.
More information about the Binutils
mailing list