NAME=ELF: endbr-main-mov
FILE=bins/elf/endbr-main
CMDS=?v main
EXPECT=<<EOF
0x401126
EOF
EXPECT_ERR=<<EOF
EOF
RUN

NAME=ELF: main
FILE=bins/elf/analysis/main
CMDS=?v main
EXPECT=<<EOF
0x400506
EOF
RUN

NAME=ELF: main rebased 0
FILE=bins/elf/analysis/pie-main
ARGS=-B 0x200000
CMDS=?v main
EXPECT=<<EOF
0x203bd0
EOF
RUN

NAME=ELF: main rebased 1
FILE=bins/elf/analysis/pie-main
ARGS=-B 0x100000
CMDS=?v main
EXPECT=<<EOF
0x103bd0
EOF
RUN

NAME=ELF: main rebased 2
FILE=bins/elf/analysis/main
ARGS=-B 0x200000
CMDS=?v main
EXPECT=<<EOF
0x200506
EOF
RUN

NAME=ELF: main rebased 3
FILE=-
ARGS=-B 0x200000
CMDS=!rz-bin -qMB 0x200000 bins/elf/analysis/main
EXPECT=2098438
RUN

NAME=ELF: sym.main
FILE=bins/elf/analysis/main
CMDS=?v sym.main
EXPECT=<<EOF
0x400506
EOF
RUN

NAME=ELF: pie main
FILE=bins/elf/analysis/pie-main
CMDS=?v main
EXPECT=<<EOF
0x3bd0
EOF
RUN

NAME=MIPS: main
FILE=bins/elf/analysis/mips-main
CMDS=?v main
EXPECT=<<EOF
0x4006f0
EOF
RUN

NAME=main non common LD script
FILE=bins/elf/analysis/custom_ldscript
CMDS=?v main
EXPECT=<<EOF
0x1c00844
EOF
RUN

NAME=main wrong sections
FILE=bins/elf/analysis/main_wrong_sect
CMDS=?v main
EXPECT=<<EOF
0x400506
EOF
RUN

NAME=main detection linux64 endbr64
FILE=bins/elf/analysis/linux_x64_endbr64
CMDS=?v main
EXPECT=<<EOF
0x4070
EOF
RUN

NAME=main - arm - buildroot-201402
FILE=bins/arm/elf/hello_world-buildroot-201402
CMDS=<<EOF
?v main
aaa
afo main
!!rz-bin -M ${RZ_FILE}
EOF
EXPECT=<<EOF
0x8370
0x00008370
[Main]
vaddr=0x00008370 paddr=0x00000370
EOF
RUN

NAME=main - arm - linaro-201201
FILE=bins/arm/elf/hello_world-linaro-201201
CMDS=<<EOF
?v main
aaa
afo main
!!rz-bin -M ${RZ_FILE}
EOF
EXPECT=<<EOF
0x82ec
0x000082ec
[Main]
vaddr=0x000082ec paddr=0x000002ec
EOF
RUN

NAME=main - arm - linaro-201902
FILE=bins/arm/elf/hello_world-linaro-201902
CMDS=<<EOF
?v main
aaa
afo main
!!rz-bin -M ${RZ_FILE}
EOF
EXPECT=<<EOF
0x10310
0x00010310
[Main]
vaddr=0x00010310 paddr=0x00000310
EOF
RUN
