2013-08-08 22:27:13 +00: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 05:10:28 +00:00
|
|
|
SECNAME: invalid string offset
|
2015-07-20 03:31:25 +00:00
|
|
|
|
|
|
|
|
2013-08-08 22:27:13 +00: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 05:10:28 +00:00
|
|
|
SECDATA: invalid section offset
|
2015-07-20 03:31:25 +00:00
|
|
|
|
|
|
|
|
2013-08-08 22:27:13 +00: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 05:10:28 +00:00
|
|
|
SYMNAME: invalid string offset
|
2015-07-20 03:31:25 +00:00
|
|
|
|
|
|
|
|
2013-08-08 22:27:13 +00: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 21:54:37 +00:00
|
|
|
VER: Error reading file: Invalid version entry.
|
2015-07-20 03:38:17 +00: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 13:35:33 +00: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 05:10:28 +00:00
|
|
|
PHENTSIZE: invalid e_phentsize
|
2015-07-20 14:45:03 +00:00
|
|
|
|
2016-02-16 14:17:48 +00: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 20:07:50 +00: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 14:50:39 +00:00
|
|
|
RELOC: Invalid entity size
|
2015-07-20 21:23:29 +00: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 16:48:00 +00:00
|
|
|
DYN-TABLE-SIZE: Invalid entity size
|
2015-08-07 15:25:20 +00: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.
|