NAME=sections list
FILE=bins/elf/analysis/main_wrong_sect
CMDS=iS;iSS
EXPECT=<<EOF
[Sections]

nth paddr        size vaddr       vsize perm name               type       flags
--------------------------------------------------------------------------------
0   0x00000000    0x0 0x00000000    0x0 ----                    NULL       
1   0x00000200   0x1c 0x00404500   0x1c -r-- .interp            PROGBITS   alloc
2   0x0000021c   0x20 0x0040021c   0x20 -r-- .note.ABI-tag      NOTE       alloc
3   0x0000023c   0x24 0x0040023c   0x24 -r-- .note.gnu.build-id NOTE       alloc
4   0x00000260   0x1c 0x00400260   0x1c -r-- .gnu.hash          GNU_HASH   alloc
5   0x00000280   0x60 0x00400280   0x60 -r-- .dynsym            DYNSYM     alloc
6   0x000002e0   0x3d 0x004002e0   0x3d -r-- .dynstr            STRTAB     alloc
7   0x0000031e    0x8 0x0040031e    0x8 -r-- .gnu.version       VERSYM     alloc
8   0x00000328   0x20 0x00400328   0x20 -r-- .gnu.version_r     VERNEED    alloc
9   0x00000348   0x18 0x00400348   0x18 -r-- .rela.dyn          RELA       alloc
10  0x00000360   0x48 0x00400360   0x48 -r-- .rela.plt          RELA       alloc
11  0x000003a8   0x1a 0x004003a8   0x1a -r-x .init              PROGBITS   alloc,execute
12  0x000003d0   0x40 0x004003d0   0x40 -r-x .plt               PROGBITS   alloc,execute
13  0x00000410  0x1a2 0x00410570  0x1a2 -r-x .text              PROGBITS   alloc,execute
14  0x000005b4    0x9 0x004005b4    0x9 -r-x .fini              PROGBITS   alloc,execute
15  0x000005c0   0x10 0x004005c0   0x10 -r-- .rodata            PROGBITS   alloc
16  0x000005d0   0x34 0x004005d0   0x34 -r-- .eh_frame_hdr      PROGBITS   alloc
17  0x00000608   0xd4 0x00400608   0xd4 -r-- .eh_frame          PROGBITS   alloc
18  0x000006e0    0x8 0x006006e0    0x8 -rw- .init_array        INIT_ARRAY write,alloc
19  0x000006e8    0x8 0x006006e8    0x8 -rw- .fini_array        FINI_ARRAY write,alloc
20  0x000006f0    0x8 0x006006f0    0x8 -rw- .jcr               PROGBITS   write,alloc
21  0x000006f8  0x1d0 0x006006f8  0x1d0 -rw- .dynamic           DYNAMIC    write,alloc
22  0x000008c8    0x8 0x006008c8    0x8 -rw- .got               PROGBITS   write,alloc
23  0x000008d0   0x30 0x006008d0   0x30 -rw- .got.plt           PROGBITS   write,alloc
24  0x00000900   0x10 0x00600900   0x10 -rw- .data              PROGBITS   write,alloc
25  0x00000910    0x0 0x00600910    0x8 -rw- .bss               NOBITS     write,alloc
26  0x00000910   0x22 0x00000000   0x22 ---- .comment           PROGBITS   merge,strings
27  0x00000940   0xd0 0x00000000   0xd0 ---- .debug_aranges     PROGBITS   
28  0x00000a10  0x188 0x00000000  0x188 ---- .debug_info        PROGBITS   
29  0x00000b98   0x76 0x00000000   0x76 ---- .debug_abbrev      PROGBITS   
30  0x00000c0e  0x149 0x00000000  0x149 ---- .debug_line        PROGBITS   
31  0x00000d57   0x8a 0x00000000   0x8a ---- .debug_str         PROGBITS   merge,strings
32  0x00000df0   0x80 0x00000000   0x80 ---- .debug_ranges      PROGBITS   
33  0x00000e70  0x156 0x00000000  0x156 ---- .shstrtab          STRTAB     
34  0x000018c8  0x6d8 0x00000000  0x6d8 ---- .symtab            SYMTAB     
35  0x00001fa0  0x23a 0x00000000  0x23a ---- .strtab            STRTAB     

[Segments]

nth paddr        size vaddr       vsize perm name
-------------------------------------------------
0   0x00000040  0x1c0 0x00400040  0x1c0 -r-x PHDR
1   0x00000200   0x1c 0x00400200   0x1c -r-- INTERP
2   0x00000000  0x6dc 0x00400000  0x6dc -r-x LOAD0
3   0x000006e0  0x230 0x006006e0  0x238 -rw- LOAD1
4   0x000006f8  0x1d0 0x006006f8  0x1d0 -rw- DYNAMIC
5   0x0000021c   0x44 0x0040021c   0x44 -r-- NOTE
6   0x000005d0   0x34 0x004005d0   0x34 -r-- GNU_EH_FRAME
7   0x00000000    0x0 0x00000000    0x0 -rw- GNU_STACK
8   0x00000000   0x40 0x00400000   0x40 -rw- ehdr

EOF
RUN

NAME=section text start (not mapped)
FILE=bins/elf/analysis/main_wrong_sect
CMDS=?v section..text
EXPECT=<<EOF
0x410570
EOF
RUN

NAME=only phdrs mapped
FILE=bins/elf/analysis/main_wrong_sect
CMDS=p8 10 @ section..text
EXPECT=<<EOF
ffffffffffffffffffff
EOF
RUN
