[test/Object] - Cleanup the Object\obj2yaml.test a bit.
[llvm-complete.git] / test / Object / elf-invalid-phdr.test
blobb779171dfbb3ad6a1bfd5d7922a665ff45c5a041
1 # invalid-phdr.elf is generated by creating a simple elf file with yaml2obj:
2 # !ELF
3 # FileHeader:
4 #   Class:           ELFCLASS64
5 #   Data:            ELFDATA2LSB
6 #   Type:            ET_EXEC
7 #   Machine:         EM_X86_64
8 # Sections:
9 #   - Name:            .text
10 #     Type:            SHT_PROGBITS
11 #     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
12 #     AddressAlign:    0x0000000000001000
13 #     Content:         "00000000"
14 # ProgramHeaders:
15 #   - Type: PT_LOAD
16 #     Flags: [ PF_X, PF_R ]
17 #     VAddr: 0xAAAA1000
18 #     PAddr: 0xFFFF1000
19 #     Sections:
20 #       - Section: .text
22 # Then editing the e_phoff in with a hexeditor to set it to 0xffffff
23 RUN: not llvm-objdump -private-headers %p/Inputs/invalid-phdr.elf 2>&1 \
24 RUN:         | FileCheck %s
26 CHECK: LLVM ERROR: program headers are longer than binary of size 4162: e_phoff = 0xffffff, e_phnum = 1, e_phentsize = 56