This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
"-g --relax" , debugging information with binutils
- From: Sumanth Gundapaneni <Sumanth dot Gundapaneni at kpitcummins dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>, "MR dot Swami dot Reddy at nsc dot com" <MR dot Swami dot Reddy at nsc dot com>
- Cc: "Jayant R. Sonar" <Jayant dot Sonar at kpitcummins dot com>
- Date: Wed, 5 Jan 2011 14:34:21 +0530
- Subject: "-g --relax" , debugging information with binutils
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