This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

mips-elf executables lack debug information


I've built a mips-elf cross-compiler that runs on a Linux host for a custom
embedded target. It uses newlib. It compiles and links good code. I can see
from the disassembly that the code is compiled correctly and the symbols are
resolved appropriately. But my problem is that the file doesn't seem to
contain debugging information.  objdump says:

	$ mips-elf-objdump -g x.elf
		x.elf:  file format elf32-bigmips
		mips-elf-objdump: x.elf: no recognized debugging information

objdump shows the following sections:

	$ mips-elf-objdump -h x.elf
		Idx Name
		  0 .text
		  1 .data
		  2 .sbss
		  3 .bss
		  4 .reginfo
		  5 .mdebug

I'm not so familiar with debugging information but I might have expected a
symbol table section (.stab) and stab strings (.stabstr). I think that my
problem is with the compiler rather than the linker because the final
executable and the intermediate executables both contain the same sections
and generate the same debugging information error message. Does anyone
understand my problem? Any suggestions? Insightful comments on where to dig
deeper?

Has there been a change in the debugger output since the cygnus 2.7.2
compiler? I have access to one of these and can see that its executables
have .stab and stabstr sections. 

Here are the command lines I used to compile and link:

$ mips-elf-gcc -mcpu-r4000 -mips2 -mfp32 -mgp32 -G 0  -fvolatile -g -c -o
x.o x.c
$ mips-elf-ld -stat-ic -nostdlibs -N --verbose -N -o x.elf x.o -Tx.lcf

My link control file is plain vanilla:

SECTIONS {
 .text : ( * (.text) }
 .data { * (.data) }
 .bss ( * (.bss) }
}

It doesn't matter if I use this one or the default link control file.

I followed Bill Gatliff's instructions to build the cross-compiler, except
that I used mips-elf as the target.

Thanks 
David


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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