DWARF problem:bad .text reference from .debug_line section.
Nitin Gupta, Noida
niting@noida.hcltech.com
Mon Aug 5 06:16:00 GMT 2002
Hi,
The text section references in the DWARF information
generated by gcc for the C++ programs are not correct.
The linker is not able to resolve the relocation
entries of a few .text references of the object files
in libstdc++ library. Following are the two such
library objects of which the references are not
resolved correctly:
libstdc++/src/io-inst.o
libstdc++/src/stdexcept.o
I'm not attaching detailed analysis report
because that will make the message too longish
and unreadable. The problem is reproducible in
C++ hello world test case.
To reproduce
- build the test case with <target>-g++ -O2
- run readelf -wl (to get the .debug_line section)
- search for the "set Address to 0x0". All the
text references would be calculated from 0x0
in that line sequence hence all will be wrong.
I can send the slice of dumps if required.
I saw the relocation entries for these references and
found that at all the places (in .debug_ranges ,
.debug_info etc ) where ever the "these" relocation needs
to applied the executable contains 0x0. Since I don't
understand the relocation entries very well, I'm not sure
whose problem is this compiler or linker or is it me
overlooking something. However I could reproduce this
"behavior" with following development environments:
1) sh-elf on Linux
gcc ver 3.1.1
binutils ver 2.12
2.) sh-elf mingw32nsvc
gcc ver 3.2
binutils ver 2.12
3.) i386-pc-linux-gnu
gcc ver 3.2
binutils ver 2.11.93.0.2 20020207 (default with RedHat 7.3)
Please let me know if I need to more analysis!
Regards.
Nitin.
PS: I used hello world test program
#include<iostream.h>
main(int argc, char *argv[])
{
cout<< "Hello World";
return 0;
}
More information about the Gcc
mailing list