Michael J. Spencer | 126973b | 2013-08-08 22:27:13 +0000 | [diff] [blame] | 1 | // Section name offset overflows section name string table. |
| 2 | RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections \ |
| 3 | RUN: 2>&1 | FileCheck --check-prefix=SECNAME %s |
| 4 | |
Davide Italiano | 6cf0926 | 2016-11-16 05:10:28 +0000 | [diff] [blame] | 5 | SECNAME: invalid string offset |
Rafael Espindola | c46ffb7 | 2015-07-20 03:31:25 +0000 | [diff] [blame] | 6 | |
| 7 | |
Michael J. Spencer | 126973b | 2013-08-08 22:27:13 +0000 | [diff] [blame] | 8 | // Section data offset past end of file. |
| 9 | RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections -section-data \ |
| 10 | RUN: 2>&1 | FileCheck --check-prefix=SECDATA %s |
| 11 | |
Davide Italiano | 6cf0926 | 2016-11-16 05:10:28 +0000 | [diff] [blame] | 12 | SECDATA: invalid section offset |
Rafael Espindola | c46ffb7 | 2015-07-20 03:31:25 +0000 | [diff] [blame] | 13 | |
| 14 | |
Michael J. Spencer | 126973b | 2013-08-08 22:27:13 +0000 | [diff] [blame] | 15 | // Symbol name offset overflows string table. |
| 16 | RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -symbols \ |
| 17 | RUN: 2>&1 | FileCheck --check-prefix=SYMNAME %s |
| 18 | |
Davide Italiano | 6cf0926 | 2016-11-16 05:10:28 +0000 | [diff] [blame] | 19 | SYMNAME: invalid string offset |
Rafael Espindola | c46ffb7 | 2015-07-20 03:31:25 +0000 | [diff] [blame] | 20 | |
| 21 | |
Michael J. Spencer | 126973b | 2013-08-08 22:27:13 +0000 | [diff] [blame] | 22 | // Version index in .gnu.version overflows the version map. |
| 23 | RUN: not llvm-readobj %p/Inputs/corrupt-version.elf-x86_64 -dt \ |
| 24 | RUN: 2>&1 | FileCheck --check-prefix=VER %s |
| 25 | |
Rafael Espindola | 8b3b09f | 2015-08-06 21:54:37 +0000 | [diff] [blame] | 26 | VER: Error reading file: Invalid version entry. |
Rafael Espindola | 00ddb14 | 2015-07-20 03:38:17 +0000 | [diff] [blame] | 27 | |
| 28 | |
| 29 | // The file is missing the dynamic string table but has references to it. |
| 30 | RUN: not llvm-readobj -dynamic-table %p/Inputs/corrupt-invalid-strtab.elf.x86-64 \ |
| 31 | RUN: 2>&1 | FileCheck --check-prefix=STRTAB %s |
| 32 | |
| 33 | STRTAB: Invalid dynamic string table reference |
Rafael Espindola | 073624b | 2015-07-20 13:35:33 +0000 | [diff] [blame] | 34 | |
| 35 | RUN: not llvm-readobj -program-headers \ |
| 36 | RUN: %p/Inputs/corrupt-invalid-phentsize.elf.x86-64 2>&1 | \ |
| 37 | RUN: FileCheck --check-prefix=PHENTSIZE %s |
| 38 | |
Davide Italiano | 6cf0926 | 2016-11-16 05:10:28 +0000 | [diff] [blame] | 39 | PHENTSIZE: invalid e_phentsize |
Rafael Espindola | 836f2e8 | 2015-07-20 14:45:03 +0000 | [diff] [blame] | 40 | |
Rafael Espindola | 6009db6 | 2016-02-16 14:17:48 +0000 | [diff] [blame] | 41 | RUN: not llvm-readobj -dynamic-table \ |
| 42 | RUN: %p/Inputs/corrupt-invalid-virtual-addr.elf.x86-64 2>&1 | \ |
| 43 | RUN: FileCheck --check-prefix=VIRTADDR %s |
| 44 | |
| 45 | VIRTADDR: Virtual address is not in any segment |
| 46 | |
| 47 | |
Rafael Espindola | 33f2509 | 2015-07-20 20:07:50 +0000 | [diff] [blame] | 48 | RUN: not llvm-readobj -dyn-relocations \ |
| 49 | RUN: %p/Inputs/corrupt-invalid-relocation-size.elf.x86-64 2>&1 | \ |
| 50 | RUN: FileCheck --check-prefix=RELOC %s |
| 51 | |
Rafael Espindola | c70aeda | 2016-02-16 14:50:39 +0000 | [diff] [blame] | 52 | RELOC: Invalid entity size |
Rafael Espindola | b68a16c | 2015-07-20 21:23:29 +0000 | [diff] [blame] | 53 | |
| 54 | RUN: not llvm-readobj -dyn-relocations \ |
| 55 | RUN: %p/Inputs/corrupt-invalid-dynamic-table-size.elf.x86-64 2>&1 | \ |
| 56 | RUN: FileCheck --check-prefix=DYN-TABLE-SIZE %s |
| 57 | |
Rafael Espindola | e17c3f3 | 2016-02-17 16:48:00 +0000 | [diff] [blame] | 58 | DYN-TABLE-SIZE: Invalid entity size |
Rafael Espindola | e01f43b | 2015-08-07 15:25:20 +0000 | [diff] [blame] | 59 | |
| 60 | |
| 61 | RUN: not llvm-readobj -dyn-relocations \ |
| 62 | RUN: %p/Inputs/corrupt-invalid-dynamic-table-offset.elf.x86-64 2>&1 | \ |
| 63 | RUN: FileCheck --check-prefix=DYN-TABLE-OFFSET %s |
| 64 | |
| 65 | DYN-TABLE-OFFSET: Invalid data was encountered while parsing the file. |
| 66 | |
| 67 | |
| 68 | RUN: not llvm-readobj -dyn-relocations \ |
| 69 | RUN: %p/Inputs/corrupt-invalid-dynamic-table-too-large.elf.x86-64 2>&1 | \ |
| 70 | RUN: FileCheck --check-prefix=DYN-TABLE-TOO-LARGE %s |
| 71 | |
| 72 | DYN-TABLE-TOO-LARGE: Invalid data was encountered while parsing the file. |