"-g --relax" , debugging information with binutils
Sumanth Gundapaneni
Sumanth.Gundapaneni@kpitcummins.com
Wed Jan 5 09:04:00 GMT 2011
Hi Swami,
We have been working on CR16 gcc backend port for some time.
We have posted the gcc patches at following link:-
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01676.html
We have validated the tool chain against various test suites and
cornered some bugs . One among them is related to compiling the
code with "-g " and linking with "--relax " flag. The debug
information for the above mentioned case was generated using
readelf and found out the issue was similar to the one discussed
by you in binutils mailing list at following link:-
http://sourceware.org/ml/binutils/2009-12/msg00099.html
Can you please let us know if there are any improvements in this
issue?
Please find the explanation below for the particular test case,
if our understanding was correct .
Case1: (without relaxation)
22354: 00 18 e6 00 beq *+0x2243a <.L37>:m
22358: 12 00 30 b2 loadd 0x20020 <_al+0x4>:l,(r4,r3)
2235c: 20 00
And the debug information was apt as per the code generated
Case2: (with relaxation)
222b0: 0c 16 beq *+0x22388 <.L37>:s
222b2: 12 00 30 b2 loadd 0x20020 <_al+0x4>:l,(r4,r3)
222b6: 20 00
It can be observed in the debugging information dump that, the pc
was incremented from 0x222b0 to 0x222b4 instead of 0x222b2. Though
the PC values and alignments were taken care, the debugging
information was broken with relaxation. The debugging information
generated still assumes the concerned branch was not relaxed.
Thanks and Regards,
Sumanth G
More information about the Binutils
mailing list