This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

DWARF problem:bad .text reference from .debug_line section.

	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:
	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 20020207 (default with RedHat 7.3)

	Please let me know if I need to more analysis!


PS: I used hello world test program

main(int argc, char *argv[])
	cout<< 	"Hello World";
	return 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]