H8300-elf-as DWARF problem preliminary analysis

Nitin Gupta, Noida niting@noida.hcltech.com
Sat Aug 10 01:00:00 GMT 2002


Hi Nick,
	I get this problem in the simplest of the program that
	I build in my environment. I'm using 
	gcc 3.1.1 released and gcc 3.2 20020703
	binutils 1.12
	newlib 1.10

	Here are the steps I followed	for building 
	The "Hello World" program.
	$ cat test.c
	main()
	{
        printf("Hello World\n");
	}
	$ h8300-elf-gcc -v -c -g -o test.o test.c
	Reading specs from
/home/niting/gcc_release/h8300-elf/tools/bin/../lib/gcc-lib/h8300-elf/3.1.1/
specs
	Configured with: /home/niting/WorkArea/gcc-3_1_1/configure 
	--prefix=/home/niting/gcc_release/h8300-elf/tools/ --
target=h8300-elf 
	--with-newlib --enable-languages=c,c++ --with-gnu-ld 
	--with-gnu-as
--with-ld=/home/niting/gcc_release/h8300-elf/tools/h8300-elf/bin/ld 
	--with-as=/home/niting/gcc_release/h8300-elf/tools/h8300-elf/bin/as 
	
--with-headers=/home/niting/gcc_release/newlib-1.10.0/newlib/libc/include/
	Thread model: single	
	gcc version 3.1.1
	
/home/niting/gcc_release/h8300-elf/tools/bin/../lib/gcc-lib/h8300-elf/3.1.1/
cc1 
	-lang-c -v -iprefix
/home/niting/gcc_release/h8300-elf/tools/bin/../lib/gcc-lib/h8300-elf/3.1.1/

	-D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=1
-D__LONG_MAX__=2147483647L 
	-D__LONG_LONG_MAX__=2147483647L -D__LONG_MAX__=2147483647L 
	-D__LONG_LONG_MAX__=2147483647L -D__NO_INLINE__ -D__STDC_HOSTED__=1
-D__H8300__ 
	-D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -Acpu=h8300
-Amachine=h8300 
	-D__INT_MAX__=32767 -D__ELF__ test.c -quiet -dumpbase test.c -g -
version -o /tmp/ccjzgasp.s
	GNU CPP version 3.1.1 (cpplib) (Hitachi H8/300)
	GNU C version 3.1.1 (h8300-elf)
        compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.3
2.96-110).
	ignoring duplicate directory
"/home/niting/gcc_release/h8300-elf/tools/lib/gcc-lib/h8300-elf/3.1.1/includ
e"
	ignoring duplicate directory
"/home/niting/gcc_release/h8300-elf/tools/h8300-elf/sys-include"
	ignoring duplicate directory
"/home/niting/gcc_release/h8300-elf/tools/h8300-elf/include"
	#include "..." search starts here:
	#include <...> search starts here:
	
/home/niting/gcc_release/h8300-elf/tools/lib/gcc-lib/h8300-elf/3.1.1/include
	 /home/niting/gcc_release/h8300-elf/tools/h8300-elf/sys-include
	 /home/niting/gcc_release/h8300-elf/tools/h8300-elf/include
	 /home/niting/gcc_release/h8300-elf/tools/include
	End of search list.
	 /home/niting/gcc_release/h8300-elf/tools/h8300-elf/bin/as 
	--traditional-format -o test.o /tmp/ccjzgasp.s
	$ readelf -wl test.o

	Dump of debug contents of section .debug_line:

	  Length:                      0
	  DWARF Version:               2
	  Prologue Length:             0
	  Minimum Instruction Length:  1
	  Initial value of 'is_stmt':  1
	  Line Base:                   -10
	  Line Range:                  245
	  Opcode Base:                 10
	
	 Opcodes:
	  Opcode 1 has 0 args
	  Opcode 2 has 1 args
	  Opcode 3 has 1 args
	  Opcode 4 has 1 args
	  Opcode 5 has 1 args
	  Opcode 6 has 0 args
	  Opcode 7 has 0 args
	  Opcode 8 has 0 args
	  Opcode 9 has 1 args

	 The Directory Table is empty.

	 The File Name Table:
	  Entry Dir     Time    Size    Name
	  1     0       0       0       test.c

	 Line Number Statements:

	readelf: Warning: The line info appears to be corrupt - the section
is too small

	This happens probably because prologue length is yet 
	to be relocated. Anyway even after linking the 
	prologue length is 36 which I think should be 26.
	I have seen the .s file (h8300-elf-gcc -S -dA test.c),
	the labels in .debug_line seems to be correct.

	Please Note: 
	- The same results are obtained if h8300-elf-readelf is 
	used instead. 
	- The same "behaviour" is seen with h8300-elf-mingw32msvc 
	build using binutils 1.12 and gcc 3.2 20020703 (experimental)
	- readelf reports some other problem in .debug_line of 
	the linked executable.
	
	Please let me know if I need to produce more info.

Thanks and Regards.
Nitin


> -----Original Message-----
> From: Nick Clifton [mailto:nickc@redhat.com]
> Sent: Friday, August 09, 2002 11:05 PM
> To: Nitin Gupta, Noida
> Cc: binutils@sources.redhat.com
> Subject: Re: H8300-elf-as DWARF problem preliminary analysis
> 
> 
> Hi Nitin,
> 
> > 	This is in reference to my previous posting:
> > 	http://sources.redhat.com/ml/binutils/2002-08/msg00050.html
> 
> Can you send a *small* test case to reproduce this problem, along with
> directions on how to compile/assemble it please ?
> 
> Cheers
>         Nick
> 



More information about the Binutils mailing list