This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

Re: dwarf2 problem


On Thu, Jun 29, 2000 at 08:21:11AM -0400, Ed Hepler wrote:
> It is compiled using:
> 
>   m68k-elf-gcc -m68000 -gdwarf-2 -O2 -Tv68k.ld -o hello hello.c
[...]
> it returns:Reading symbols from hello... Dwarf Error: bad offset
> (0x1677c) in compilation unit header (offset 0x0 + 6).

It's quite obvious from your typescript what the problem is:

  3 .debug_abbrev 000028ac  00018068  00018068  0000a060  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_info   00018a17  0001a914  0001a914  0000c90c  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_line   000093fa  0003332b  0003332b  00025323  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_pubnames 00000921  0003c725  0003c725  0002e71d  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_aranges 000004e0  0003d046  0003d046  0002f03e  2**0
                  CONTENTS, READONLY, DEBUGGING

All the dwarf[12] sections should be forced to address zero in
your linker script.  If you'll examine one of the distributed
link scripts you'll find

  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }



r~

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