NAME=sections list
FILE=bins/elf/analysis/main_wrong_sect
CMDS=iS;iSS
EXPECT=<<EOF
nth paddr        size vaddr       vsize perm flags type        name
-------------------------------------------------------------------
0   0x00000000    0x0 0x00000000    0x0 ---- 0x0   NULL
1   0x00000200   0x1c 0x00404500   0x1c -r-- 0x2   PROGBITS    .interp
2   0x0000021c   0x20 0x0040021c   0x20 -r-- 0x2   NOTE        .note.ABI-tag
3   0x0000023c   0x24 0x0040023c   0x24 -r-- 0x2   NOTE        .note.gnu.build-id
4   0x00000260   0x1c 0x00400260   0x1c -r-- 0x2   GNU_HASH    .gnu.hash
5   0x00000280   0x60 0x00400280   0x60 -r-- 0x2   DYNSYM      .dynsym
6   0x000002e0   0x3d 0x004002e0   0x3d -r-- 0x2   STRTAB      .dynstr
7   0x0000031e    0x8 0x0040031e    0x8 -r-- 0x2   GNU_VERSYM  .gnu.version
8   0x00000328   0x20 0x00400328   0x20 -r-- 0x2   GNU_VERNEED .gnu.version_r
9   0x00000348   0x18 0x00400348   0x18 -r-- 0x2   RELA        .rela.dyn
10  0x00000360   0x48 0x00400360   0x48 -r-- 0x2   RELA        .rela.plt
11  0x000003a8   0x1a 0x004003a8   0x1a -r-x 0x6   PROGBITS    .init
12  0x000003d0   0x40 0x004003d0   0x40 -r-x 0x6   PROGBITS    .plt
13  0x00000410  0x1a2 0x00410570  0x1a2 -r-x 0x6   PROGBITS    .text
14  0x000005b4    0x9 0x004005b4    0x9 -r-x 0x6   PROGBITS    .fini
15  0x000005c0   0x10 0x004005c0   0x10 -r-- 0x2   PROGBITS    .rodata
16  0x000005d0   0x34 0x004005d0   0x34 -r-- 0x2   PROGBITS    .eh_frame_hdr
17  0x00000608   0xd4 0x00400608   0xd4 -r-- 0x2   PROGBITS    .eh_frame
18  0x000006e0    0x8 0x006006e0    0x8 -rw- 0x3   INIT_ARRAY  .init_array
19  0x000006e8    0x8 0x006006e8    0x8 -rw- 0x3   FINI_ARRAY  .fini_array
20  0x000006f0    0x8 0x006006f0    0x8 -rw- 0x3   PROGBITS    .jcr
21  0x000006f8  0x1d0 0x006006f8  0x1d0 -rw- 0x3   DYNAMIC     .dynamic
22  0x000008c8    0x8 0x006008c8    0x8 -rw- 0x3   PROGBITS    .got
23  0x000008d0   0x30 0x006008d0   0x30 -rw- 0x3   PROGBITS    .got.plt
24  0x00000900   0x10 0x00600900   0x10 -rw- 0x3   PROGBITS    .data
25  0x00000910    0x0 0x00600910    0x8 -rw- 0x3   NOBITS      .bss
26  0x00000910   0x22 0x00000000   0x22 ---- 0x30  PROGBITS    .comment
27  0x00000940   0xd0 0x00000000   0xd0 ---- 0x0   PROGBITS    .debug_aranges
28  0x00000a10  0x188 0x00000000  0x188 ---- 0x0   PROGBITS    .debug_info
29  0x00000b98   0x76 0x00000000   0x76 ---- 0x0   PROGBITS    .debug_abbrev
30  0x00000c0e  0x149 0x00000000  0x149 ---- 0x0   PROGBITS    .debug_line
31  0x00000d57   0x8a 0x00000000   0x8a ---- 0x30  PROGBITS    .debug_str
32  0x00000df0   0x80 0x00000000   0x80 ---- 0x0   PROGBITS    .debug_ranges
33  0x00000e70  0x156 0x00000000  0x156 ---- 0x0   STRTAB      .shstrtab
34  0x000018c8  0x6d8 0x00000000  0x6d8 ---- 0x0   SYMTAB      .symtab
35  0x00001fa0  0x23a 0x00000000  0x23a ---- 0x0   STRTAB      .strtab
nth paddr        size vaddr       vsize perm flags type name
------------------------------------------------------------
0   0x00000040  0x1c0 0x00400040  0x1c0 -r-x 0x0   MAP  PHDR
1   0x00000200   0x1c 0x00400200   0x1c -r-- 0x0   MAP  INTERP
2   0x00000000  0x6dc 0x00400000  0x6dc -r-x 0x0   MAP  LOAD0
3   0x000006e0  0x230 0x006006e0  0x238 -rw- 0x0   MAP  LOAD1
4   0x000006f8  0x1d0 0x006006f8  0x1d0 -rw- 0x0   MAP  DYNAMIC
5   0x0000021c   0x44 0x0040021c   0x44 -r-- 0x0   MAP  NOTE
6   0x000005d0   0x34 0x004005d0   0x34 -r-- 0x0   MAP  GNU_EH_FRAME
7   0x00000000    0x0 0x00000000    0x0 -rw- 0x0   MAP  GNU_STACK
8   0x00000000   0x40 0x00400000   0x40 -rw- 0x0   MAP  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

NAME=sections list here bss
FILE=bins/elf/analysis/main_wrong_sect
CMDS=iS.@0x00600914~bss~?
EXPECT=<<EOF
1
EOF
RUN
