blob: 9cbe9ef5e0896e1da6c9b96fee12b935ea0cdc45 [file] [log] [blame]
Michael J. Spencer126973b2013-08-08 22:27:13 +00001// Section name offset overflows section name string table.
2RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections \
3RUN: 2>&1 | FileCheck --check-prefix=SECNAME %s
4
Davide Italiano6cf09262016-11-16 05:10:28 +00005SECNAME: invalid string offset
Rafael Espindolac46ffb72015-07-20 03:31:25 +00006
7
Michael J. Spencer126973b2013-08-08 22:27:13 +00008// Section data offset past end of file.
9RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections -section-data \
10RUN: 2>&1 | FileCheck --check-prefix=SECDATA %s
11
Davide Italiano6cf09262016-11-16 05:10:28 +000012SECDATA: invalid section offset
Rafael Espindolac46ffb72015-07-20 03:31:25 +000013
14
Michael J. Spencer126973b2013-08-08 22:27:13 +000015// Symbol name offset overflows string table.
16RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -symbols \
17RUN: 2>&1 | FileCheck --check-prefix=SYMNAME %s
18
Davide Italiano6cf09262016-11-16 05:10:28 +000019SYMNAME: invalid string offset
Rafael Espindolac46ffb72015-07-20 03:31:25 +000020
21
Michael J. Spencer126973b2013-08-08 22:27:13 +000022// Version index in .gnu.version overflows the version map.
23RUN: not llvm-readobj %p/Inputs/corrupt-version.elf-x86_64 -dt \
24RUN: 2>&1 | FileCheck --check-prefix=VER %s
25
Rafael Espindola8b3b09f2015-08-06 21:54:37 +000026VER: Error reading file: Invalid version entry.
Rafael Espindola00ddb142015-07-20 03:38:17 +000027
28
29// The file is missing the dynamic string table but has references to it.
30RUN: not llvm-readobj -dynamic-table %p/Inputs/corrupt-invalid-strtab.elf.x86-64 \
31RUN: 2>&1 | FileCheck --check-prefix=STRTAB %s
32
33STRTAB: Invalid dynamic string table reference
Rafael Espindola073624b2015-07-20 13:35:33 +000034
35RUN: not llvm-readobj -program-headers \
36RUN: %p/Inputs/corrupt-invalid-phentsize.elf.x86-64 2>&1 | \
37RUN: FileCheck --check-prefix=PHENTSIZE %s
38
Davide Italiano6cf09262016-11-16 05:10:28 +000039PHENTSIZE: invalid e_phentsize
Rafael Espindola836f2e82015-07-20 14:45:03 +000040
Rafael Espindola6009db62016-02-16 14:17:48 +000041RUN: not llvm-readobj -dynamic-table \
42RUN: %p/Inputs/corrupt-invalid-virtual-addr.elf.x86-64 2>&1 | \
43RUN: FileCheck --check-prefix=VIRTADDR %s
44
45VIRTADDR: Virtual address is not in any segment
46
47
Rafael Espindola33f25092015-07-20 20:07:50 +000048RUN: not llvm-readobj -dyn-relocations \
49RUN: %p/Inputs/corrupt-invalid-relocation-size.elf.x86-64 2>&1 | \
50RUN: FileCheck --check-prefix=RELOC %s
51
Rafael Espindolac70aeda2016-02-16 14:50:39 +000052RELOC: Invalid entity size
Rafael Espindolab68a16c2015-07-20 21:23:29 +000053
54RUN: not llvm-readobj -dyn-relocations \
55RUN: %p/Inputs/corrupt-invalid-dynamic-table-size.elf.x86-64 2>&1 | \
56RUN: FileCheck --check-prefix=DYN-TABLE-SIZE %s
57
Rafael Espindolae17c3f32016-02-17 16:48:00 +000058DYN-TABLE-SIZE: Invalid entity size
Rafael Espindolae01f43b2015-08-07 15:25:20 +000059
60
61RUN: not llvm-readobj -dyn-relocations \
62RUN: %p/Inputs/corrupt-invalid-dynamic-table-offset.elf.x86-64 2>&1 | \
63RUN: FileCheck --check-prefix=DYN-TABLE-OFFSET %s
64
65DYN-TABLE-OFFSET: Invalid data was encountered while parsing the file.
66
67
68RUN: not llvm-readobj -dyn-relocations \
69RUN: %p/Inputs/corrupt-invalid-dynamic-table-too-large.elf.x86-64 2>&1 | \
70RUN: FileCheck --check-prefix=DYN-TABLE-TOO-LARGE %s
71
72DYN-TABLE-TOO-LARGE: Invalid data was encountered while parsing the file.