This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Questions about stabs in MIPS executable
- Subject: [ECOS] Questions about stabs in MIPS executable
- From: Tim Michals <Tim dot Michals at Cygnetinc dot com>
- Date: Wed, 7 Nov 2001 08:17:23 -0600
- Cc: ecos-discuss at sources dot redhat dot com
All,
I'm working with a MIPS JTAG emulator and eCOS; in order to get source level
debug for the emulator, the elf file has to be processed through a
conversion utility to create a symbols file to be used by the debugger. I'm
trying to understand how stabs is used for example:
This is the output from mips-elf-readelf of a file that the conversion
utility is successful creating symbols on (as a side point the compiler is a
hacked gcc compiler)
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x80010040
Start of program headers: 52 (bytes into file)
Start of section headers: 7491772 (bytes into file)
Flags: 0x1, noreorder, mips1 UNKNOWN
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 2
Size of section headers: 40 (bytes)
Number of section headers: 13
Section header string table index: 10
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk
Inf Al
[ 0] NULL 00000000 000000 000000 00 0
0 0
[ 1] .text PROGBITS 80010000 010000 1eb540 00 AX 0
0 16
[ 2] .rodata PROGBITS 801fb540 1fb540 03aad0 00 A 0
0 16
[ 3] .reginfo MIPS_REGINFO 80236010 236010 000018 01 A 0
0 4
[ 4] .data PROGBITS 80236030 236030 079570 00 WA 0
0 16
[ 5] .sdata PROGBITS 802af5a0 2af5a0 000020 00 WAp 0
0 16
[ 6] .sbss NOBITS 802af5c0 2af5c0 00050c 00 WAp 0
0 8
[ 7] .bss NOBITS 802afad0 2af5c0 07a860 00 WA 0
0 16
[ 8] .stab PROGBITS 00000000 2af5c0 15c834 0c 9
0 4
[ 9] .stabstr STRTAB 00000000 40bdf4 31926d 00 0
0 1
[10] .shstrtab STRTAB 00000000 725061 000059 00 0
0 1
[11] .symtab SYMTAB 00000000 7252c4 028760 10 12
12c5 4
[12] .strtab STRTAB 00000000 74da24 01e35f 00 0
0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Using the gcc compiler with eCOS:
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x80000000
Start of program headers: 52 (bytes into file)
Start of section headers: 778900 (bytes into file)
Flags: 0x10000001, noreorder, mips2 UNKNOWN
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 1
Size of section headers: 40 (bytes)
Number of section headers: 16
Section header string table index: 13
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk
Inf Al
[ 0] NULL 00000000 000000 000000 00 0
0 0
[ 1] .rom_vectors PROGBITS 80000000 001000 000800 00 AX 0
0 1
[ 2] .text PROGBITS 80000800 001800 00b1f0 00 AX 0
0 16
[ 3] .fini PROGBITS 8000b9f0 00e990 000000 00 W 0
0 1
[ 4] .ctors PROGBITS 8000b9f0 00c9f0 000034 00 WA 0
0 4
[ 5] .dtors PROGBITS 8000ba24 00ca24 000024 00 WA 0
0 4
[ 6] .rodata PROGBITS 8000ba48 00ca48 000e38 00 A 0
0 8
[ 7] .rodata1 PROGBITS 8000c880 00e990 000000 00 W 0
0 1
[ 8] .fixup PROGBITS 8000c880 00e990 000000 00 W 0
0 1
[ 9] .gcc_except_table PROGBITS 8000c880 00e990 000000 00 W 0
0 1
[10] .data PROGBITS 8000c880 00d880 001110 00 WA 0
0 8
[11] .bss NOBITS 8000d990 00e990 808d60 00 WA 0
0 16
[12] .mdebug MIPS_DEBUG 00000000 00e990 0af884 01 0
0 4
[13] .shstrtab STRTAB 00000000 0be214 00007f 00 0
0 1
[14] .symtab SYMTAB 00000000 0be514 0031b0 10 15
109 4
[15] .strtab STRTAB 00000000 0c16c4 00265d 00 0
0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Notice how a couple of sections are missing (.stabs and .stabstr) So is this
the issue? Also another clue is if mips-elf-obj -g <file> is used on the
file created by the working gcc it dumps debug information.
Also if the same command on the eCOS compiler mips-elf-obj -g <file> it
indicates that there is no debug info? Any clues?