This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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]

RE: Questions about stabs in MIPS executable


Ha, I see what I did...my .ld file didn't have stabs

add this to the .ld file
#define SECTIONS_END . = ALIGN(4); _end = .; PROVIDE (end = .); \
  /* Stabs debugging sections.  */                              \
  .stab          0 : { *(.stab) }                               \
  .stabstr       0 : { *(.stabstr) }                            \
  .stab.excl     0 : { *(.stab.excl) }                          \
  .stab.exclstr  0 : { *(.stab.exclstr) }                       \
  .stab.index    0 : { *(.stab.index) }                         \
  .stab.indexstr 0 : { *(.stab.indexstr) }                      \
  .comment       0 : { *(.comment) }                            \
  /* DWARF debug sections.                                      \
     Symbols in the DWARF debugging sections are relative to    \
     the beginning of the section so we begin them at 0.  */    \
  /* 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) }                   \
  /* These must appear regardless of  .  */                     \
  .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }             \
  .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }                \
  /DISCARD/        0 : { *(.mdebug) }

-----Original Message-----
From: Tim Michals [mailto:Tim.Michals@Cygnetinc.com]
Sent: Thursday, November 29, 2001 8:31 AM
To: 'Jonathan Larmour'
Cc: ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] Questions about stabs in MIPS executable


Here is the .ld file.....  no mention of stabs


STARTUP(vectors.o)
ENTRY(reset_vector)
OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips")

INPUT(extras.o)

GROUP(libtarget.a libgcc.a)


MEMORY
{
    ram : ORIGIN = 0x80000000, LENGTH = 0xD00000
}

SECTIONS
{
     
    .rom_vectors   0x80000000  :      { KEEP (*(.reset_vector)) . =
ALIGN(0x100);	KEEP (*(.utlb_vector)) . = ALIGN(0x80);
KEEP(*(.other_vector)) . = ALIGN(0x800);	} >  ram  =0 
    .text   0x80006000  :      { _stext = ABSOLUTE(.); *(.text*)
*(.gnu.warning) *(.gnu.linkonce*) *(.init) } >  ram  _etext = .; PROVIDE
(etext = .); 
    .fini   ALIGN (0x1)  :      { . = . ; *(.fini) } >  ram  
    .ctors   ALIGN (0x1)  :     	{	__CTOR_LIST__ = ABSOLUTE
(.);	KEEP(*(.ctors))	KEEP(*(SORT(.ctors.*)))	__CTOR_END__ = ABSOLUTE (.);
} >  ram  
    .dtors   ALIGN (0x1)  :     	{	__DTOR_LIST__ = ABSOLUTE
(.);	KEEP(*(SORT(.dtors.*)))	KEEP(*(.dtors))	__DTOR_END__ = ABSOLUTE (.);
} >  ram  
    .rodata   ALIGN (0x1)  :      { . = . ; *(.rodata*) } >  ram  
    .rodata1   ALIGN (0x1)  :      { . = . ; *(.rodata1) } >  ram  
    .fixup   ALIGN (0x1)  :      { . = . ; *(.fixup) } >  ram  
    .rel.dyn   ALIGN (0x1)  :      { . = . ; *(.rel.dyn) } >  ram  
    .gcc_except_table   ALIGN (0x1)  :      { . = . ; *(.gcc_except_table) }
>  ram  
    .data   ALIGN (0x8)  :      { __ram_data_start = ABSOLUTE (.); *(.data*)
*(.data1) *( .2ram.*) _GOT1_START_ = ABSOLUTE (.); *(.got1) _GOT1_END_ =
ABSOLUTE (.); _GOT2_START_ = ABSOLUTE (.); *(.got2) _GOT2_END_ = ABSOLUTE
(.); . = ALIGN (8); KEEP(*( SORT (.ecos.table.*))) ; . = ALIGN (8);
_GOT_START = ABSOLUTE (.); _gp = ABSOLUTE (.); __global = _gp;
_GLOBAL_OFFSET_TABLE_ = ABSOLUTE (.); _SDA_BASE_ = ABSOLUTE (.); *(.got.plt)
*(.got) _GOT_END_ = ABSOLUTE (.); *(.dynamic) *(.lit8) *(.lit4) *(.sdata*)
*(.sbss*) *(.eh_frame) } >  ram  __rom_data_start = LOADADDR (.data);
__ram_data_end = .; PROVIDE (__ram_data_end = .); _edata = .; PROVIDE (edata
= .); 
    .bss   ALIGN (0x4)  :      { __bss_start = ABSOLUTE (.); *(.scommon)
*(.dynbss) *(.bss) *(COMMON) __bss_end = ABSOLUTE (.); } >  ram  
     __heap1   = ALIGN (0x8);
    . = ALIGN(4); _end = .; PROVIDE (end = .); .debug           0 : {
*(.debug) } .line            0 : { *(.line) } .debug_srcinfo   0 : {
*(.debug_srcinfo) } .debug_sfnames   0 : { *(.debug_sfnames) }
.debug_aranges   0 : { *(.debug_aranges) } .debug_pubnames  0 : {
*(.debug_pubnames) } .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) } .debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) } .debug_typenames 0 : {
*(.debug_typenames) } .debug_varnames  0 : { *(.debug_varnames) } /DISCARD/
: { *(.debug_vector) } 
}



hal_vsr_table = 0x80000400;
hal_virtual_vector_table = 0x80000600;

-----Original Message-----
From: Jonathan Larmour [mailto:jlarmour@redhat.com]
Sent: Thursday, November 29, 2001 8:30 AM
To: Tim Michals
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Questions about stabs in MIPS executable


Tim Michals wrote:
> 
> I'm using a third party debugger (JTAG eumulator).  Yes, I can load the
> image using GDB.

Not just load it, but list the source, right? I wouldn't have thought so
because I can't see any debugging sections (.mdebug is naff and not
sufficient).
 
> I'm using the standard ecos .lnk file.  Also here is some more info:

.lnk? you mean .ld? But as I said, that .ld file may not mention the stab
sections!

Look at whether it mentions the .stab and .stabstr etc. sections.

Jifl

I wrote:
> 
> If you just load it up in GDB (even though not downloading) does that
work?
> Can you list functions and source files? By the looks of it, that
shouldn't
> work, but I want to check :).
> 
> It's possible that the eCos linker script you are using (you don't say
> what) doesn't mention the stabs sections, perhaps because it is normally
> expecting dwarf debug. Check that out.


-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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