2013-08-09 00:27:13 +02:00
|
|
|
// Section name offset overflows section name string table.
|
|
|
|
RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections \
|
|
|
|
RUN: 2>&1 | FileCheck --check-prefix=SECNAME %s
|
|
|
|
|
2016-11-16 06:10:28 +01:00
|
|
|
SECNAME: invalid string offset
|
2015-07-20 05:31:25 +02:00
|
|
|
|
|
|
|
|
2013-08-09 00:27:13 +02:00
|
|
|
// Section data offset past end of file.
|
|
|
|
RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections -section-data \
|
|
|
|
RUN: 2>&1 | FileCheck --check-prefix=SECDATA %s
|
|
|
|
|
2016-11-16 06:10:28 +01:00
|
|
|
SECDATA: invalid section offset
|
2015-07-20 05:31:25 +02:00
|
|
|
|
|
|
|
|
2013-08-09 00:27:13 +02:00
|
|
|
// Symbol name offset overflows string table.
|
|
|
|
RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -symbols \
|
|
|
|
RUN: 2>&1 | FileCheck --check-prefix=SYMNAME %s
|
|
|
|
|
2016-11-16 06:10:28 +01:00
|
|
|
SYMNAME: invalid string offset
|
2015-07-20 05:31:25 +02:00
|
|
|
|
|
|
|
|
2013-08-09 00:27:13 +02:00
|
|
|
// Version index in .gnu.version overflows the version map.
|
|
|
|
RUN: not llvm-readobj %p/Inputs/corrupt-version.elf-x86_64 -dt \
|
|
|
|
RUN: 2>&1 | FileCheck --check-prefix=VER %s
|
|
|
|
|
2015-08-06 23:54:37 +02:00
|
|
|
VER: Error reading file: Invalid version entry.
|
2015-07-20 05:38:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
// The file is missing the dynamic string table but has references to it.
|
|
|
|
RUN: not llvm-readobj -dynamic-table %p/Inputs/corrupt-invalid-strtab.elf.x86-64 \
|
|
|
|
RUN: 2>&1 | FileCheck --check-prefix=STRTAB %s
|
|
|
|
|
|
|
|
STRTAB: Invalid dynamic string table reference
|
2015-07-20 15:35:33 +02:00
|
|
|
|
|
|
|
RUN: not llvm-readobj -program-headers \
|
|
|
|
RUN: %p/Inputs/corrupt-invalid-phentsize.elf.x86-64 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=PHENTSIZE %s
|
|
|
|
|
2016-11-16 06:10:28 +01:00
|
|
|
PHENTSIZE: invalid e_phentsize
|
2015-07-20 16:45:03 +02:00
|
|
|
|
2016-02-16 15:17:48 +01:00
|
|
|
RUN: not llvm-readobj -dynamic-table \
|
|
|
|
RUN: %p/Inputs/corrupt-invalid-virtual-addr.elf.x86-64 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=VIRTADDR %s
|
|
|
|
|
|
|
|
VIRTADDR: Virtual address is not in any segment
|
|
|
|
|
|
|
|
|
2015-07-20 22:07:50 +02:00
|
|
|
RUN: not llvm-readobj -dyn-relocations \
|
|
|
|
RUN: %p/Inputs/corrupt-invalid-relocation-size.elf.x86-64 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=RELOC %s
|
|
|
|
|
2016-02-16 15:50:39 +01:00
|
|
|
RELOC: Invalid entity size
|
2015-07-20 23:23:29 +02:00
|
|
|
|
|
|
|
RUN: not llvm-readobj -dyn-relocations \
|
|
|
|
RUN: %p/Inputs/corrupt-invalid-dynamic-table-size.elf.x86-64 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=DYN-TABLE-SIZE %s
|
|
|
|
|
2016-02-17 17:48:00 +01:00
|
|
|
DYN-TABLE-SIZE: Invalid entity size
|
2015-08-07 17:25:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
RUN: not llvm-readobj -dyn-relocations \
|
|
|
|
RUN: %p/Inputs/corrupt-invalid-dynamic-table-offset.elf.x86-64 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=DYN-TABLE-OFFSET %s
|
|
|
|
|
|
|
|
DYN-TABLE-OFFSET: Invalid data was encountered while parsing the file.
|
|
|
|
|
|
|
|
|
|
|
|
RUN: not llvm-readobj -dyn-relocations \
|
|
|
|
RUN: %p/Inputs/corrupt-invalid-dynamic-table-too-large.elf.x86-64 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=DYN-TABLE-TOO-LARGE %s
|
|
|
|
|
|
|
|
DYN-TABLE-TOO-LARGE: Invalid data was encountered while parsing the file.
|