This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Question: using objdump for disassembly and inserting source code with object compiled with -gsplit-dwarf
- From: "ISHIKAWA,chiaki" <ishikawa at yk dot rim dot or dot jp>
- To: Binutils <binutils at sourceware dot org>
- Date: Sat, 18 Jun 2016 05:48:20 +0900
- Subject: Question: using objdump for disassembly and inserting source code with object compiled with -gsplit-dwarf
- Authentication-results: sourceware.org; auth=none
- Authentication-results: access07.SiriusCloud.jp; dkim=none (no signature) header.i=unknown; x-dkim-adsp=none (insecure policy)
Hi,
I have been using GNU ld.gold with gcc's -gsplit-dwarf feature very
successfully to build Mozilla's thunderbird mail client.
It is a big binary but the use of -gsplit-dwarf and ld.gold has made the
linking manageable.
I have come to understand a subtle issue, though.
In the traditional full dwarf information inside .o file means,
objdump -S -d test.o
can disassemble the object file and intersperse the
lines from the original source file.
After testing with a simple small C source file,
I suppose objdump can work with an object compiled with -gsplit-dwarf to
list disassembly mixed with the original source file.
However, for a medium size c++ file, I found that the source inclusion
is not very good. The function signature is inserted, but no source code
lines somehow.
Is this to be expected?
Or is there a known bug with objdump?
It is possible that gcc 5.3 or 6.1 may not be producing correct DWARF in
.o and .dwp which objdump can grok, but I have no idea.
I can send a sample .o, .dwo, and the source file for review.
There must be something wrong because in the objdump -S -d listing
I see a repetition of a source snippet smallish helper function over and
over again.
That can't be right.
I have tested with the following version:
objdump --version
GNU objdump (GNU Binutils) 2.26.51.20160102
TIA
CI