mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
If dynamic table is missing, output "dynamic strtab not found'. If the index is out of range, output "Invalid Offset<..>". https://bugs.llvm.org/show_bug.cgi?id=40807 Reviewed by: jhenderson, grimar, MaskRay Differential Revision: https://reviews.llvm.org/D63084 Patch by Yuanfang Chen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363374 91177308-0d34-0410-b5e6-96231b3b80d8
66 lines
2.1 KiB
Plaintext
66 lines
2.1 KiB
Plaintext
// 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
|
|
|
|
SECNAME: invalid string offset
|
|
|
|
|
|
// 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
|
|
|
|
SECDATA: invalid section offset
|
|
|
|
|
|
// 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
|
|
|
|
SYMNAME: invalid string offset
|
|
|
|
|
|
// 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
|
|
|
|
VER: error: Invalid version entry
|
|
|
|
RUN: not llvm-readobj -l \
|
|
RUN: %p/Inputs/corrupt-invalid-phentsize.elf.x86-64 2>&1 | \
|
|
RUN: FileCheck --check-prefix=PHENTSIZE %s
|
|
|
|
PHENTSIZE: invalid e_phentsize
|
|
|
|
RUN: llvm-readobj --dynamic-table \
|
|
RUN: %p/Inputs/corrupt-invalid-virtual-addr.elf.x86-64 2>&1 | \
|
|
RUN: FileCheck --check-prefix=VIRTADDR %s
|
|
|
|
VIRTADDR: warning: Unable to parse DT_STRTAB: Virtual address is not in any segment
|
|
|
|
|
|
RUN: not llvm-readobj --dyn-relocations \
|
|
RUN: %p/Inputs/corrupt-invalid-relocation-size.elf.x86-64 2>&1 | \
|
|
RUN: FileCheck --check-prefix=RELOC %s
|
|
|
|
RELOC: Invalid entity size
|
|
|
|
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
|
|
|
|
DYN-TABLE-SIZE: Invalid entity size
|
|
|
|
|
|
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: error: PT_DYNAMIC segment offset + size exceeds the size of 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: error: PT_DYNAMIC segment offset + size exceeds the size of the file
|