sh-rtems and dwarf

Nick Clifton nickc@redhat.com
Wed Feb 14 10:42:00 GMT 2001


Hi Joel,

: I have checked out the binutils, gcc, and newlib sources
: from cvs checking out the rtems targets.  When building
: gcc, I get this:
: 
: /tmp/ccceY8Qj.s:1: Fatal error: dwarf2 is not supported for this
: object file format                          
: 
: sh-rtems is essentially an alias for sh-coff.  Is this a gcc or binutils
: problem?   Something is inconsistent but what?

It is both, but most likely it is a gas problem.  Basically gcc is
generating DWARF2 debug information (probably line number directives)
which are not supported in the GAS sh-rtems port.

So either the problem is that the RTEMS and COFF ports of SH should be
defaulting to use STABS instead of DWARF2, or else the GAS port
should be extended to support DWARF2 debugging directives.

Looking at tc-sh.c it appears that these have already been
added. Certainly .file and .loc are supported in md_pseudo_table, so
the probable answer is that gas/dwarf2dbg.c is being compiled without
BFD_ASSEMBLER set.  My suggestion, try adding bfd_gas=yes to
configure.in (and then regenerate configure and reconfigure/rebuild
gas).

Cheers
	Nick

Possible (but untested) patch:

Index: gas/configure.in
===================================================================
RCS file: /cvs/src//src/gas/configure.in,v
retrieving revision 1.57
diff -p -r1.57 configure.in
*** configure.in	2001/02/10 22:25:10	1.57
--- configure.in	2001/02/14 18:42:08
*************** changequote([,])dnl
*** 384,393 ****
  
        sh-*-linux*)	    fmt=elf em=linux ;;
        sh-*-elf*)	    fmt=elf ;;
!       sh-*-coff*)           fmt=coff ;;
        sh-*-pe*)             fmt=coff em=pe bfd_gas=yes;;
        sh-*-rtemself*)       fmt=elf ;;
!       sh-*-rtems*)	    fmt=coff ;;
  
        ns32k-pc532-mach* | ns32k-pc532-ux*)    fmt=aout em=pc532mach ;;
        ns32k-pc532-netbsd* | ns32k-pc532-lites*)  fmt=aout em=nbsd532 ;;
--- 384,393 ----
  
        sh-*-linux*)	    fmt=elf em=linux ;;
        sh-*-elf*)	    fmt=elf ;;
!       sh-*-coff*)           fmt=coff bfd_gas=yes;;
        sh-*-pe*)             fmt=coff em=pe bfd_gas=yes;;
        sh-*-rtemself*)       fmt=elf ;;
!       sh-*-rtems*)	    fmt=coff bfd_gas=yes;;
  
        ns32k-pc532-mach* | ns32k-pc532-ux*)    fmt=aout em=pc532mach ;;
        ns32k-pc532-netbsd* | ns32k-pc532-lites*)  fmt=aout em=nbsd532 ;;



More information about the Binutils mailing list