f2hanif
2007-11-22 23:29:27 UTC
Hi,
Elf file for kitchen program is at the end and few questions:
There will always be 3 segments ? Like right now it has:
'00 .reginfo',
'01 .reginfo .text .rodata' and
'02 .data .sbss .bss'
1. Can it possibly have more than 3 segments, it may be less, but can it
be more ?
2. Do we need to keep track of .reginfo, that is segment 00.
Thanks
Farah
testbin/kitchen readelf:
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: 0x4000b0
Start of program headers: 52 (bytes into file)
Start of section headers: 10688 (bytes into file)
Flags: 0x1001, noreorder, o32, mips1
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 3
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
[ 0] NULL 00000000 000000 000000 00
[ 1] .reginfo MIPS_REGINFO 00400094 000094 000018 18 A
[ 2] .text PROGBITS 004000b0 0000b0 000f00 00 AX
[ 3] .rodata PROGBITS 00400fb0 000fb0 000410 00 A
[ 4] .data PROGBITS 10000000 002000 000010 00 WA
[ 5] .sbss NOBITS 10000010 002010 000008 00 WAp
[ 6] .bss NOBITS 10000020 002018 000020 00 WA
[ 7] .comment PROGBITS 00000000 002018 0000c6 00
[ 8] .pdr PROGBITS 00000000 0020e0 000880 00
[ 9] .mdebug.abi32 PROGBITS 00000000 002960 000000 00
[10] .shstrtab STRTAB 00000000 002960 00005f 00
[11] .symtab SYMTAB 00000000 002bc8 0007a0 10
[12] .strtab STRTAB 00000000 003368 000380 00
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)
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
REGINFO 0x000094 0x00400094 0x00400094 0x00018 0x00018 R 0x4
LOAD 0x000000 0x00400000 0x00400000 0x013c0 0x013c0 R E 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x00010 0x00040 RW 0x1000
Section to Segment mapping:
Segment Sections...
00 .reginfo
01 .reginfo .text .rodata
02 .data .sbss .bss
Elf file for kitchen program is at the end and few questions:
There will always be 3 segments ? Like right now it has:
'00 .reginfo',
'01 .reginfo .text .rodata' and
'02 .data .sbss .bss'
1. Can it possibly have more than 3 segments, it may be less, but can it
be more ?
2. Do we need to keep track of .reginfo, that is segment 00.
Thanks
Farah
testbin/kitchen readelf:
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: 0x4000b0
Start of program headers: 52 (bytes into file)
Start of section headers: 10688 (bytes into file)
Flags: 0x1001, noreorder, o32, mips1
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 3
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
[ 0] NULL 00000000 000000 000000 00
[ 1] .reginfo MIPS_REGINFO 00400094 000094 000018 18 A
[ 2] .text PROGBITS 004000b0 0000b0 000f00 00 AX
[ 3] .rodata PROGBITS 00400fb0 000fb0 000410 00 A
[ 4] .data PROGBITS 10000000 002000 000010 00 WA
[ 5] .sbss NOBITS 10000010 002010 000008 00 WAp
[ 6] .bss NOBITS 10000020 002018 000020 00 WA
[ 7] .comment PROGBITS 00000000 002018 0000c6 00
[ 8] .pdr PROGBITS 00000000 0020e0 000880 00
[ 9] .mdebug.abi32 PROGBITS 00000000 002960 000000 00
[10] .shstrtab STRTAB 00000000 002960 00005f 00
[11] .symtab SYMTAB 00000000 002bc8 0007a0 10
[12] .strtab STRTAB 00000000 003368 000380 00
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)
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
REGINFO 0x000094 0x00400094 0x00400094 0x00018 0x00018 R 0x4
LOAD 0x000000 0x00400000 0x00400000 0x013c0 0x013c0 R E 0x1000
LOAD 0x002000 0x10000000 0x10000000 0x00010 0x00040 RW 0x1000
Section to Segment mapping:
Segment Sections...
00 .reginfo
01 .reginfo .text .rodata
02 .data .sbss .bss