2015-06-29 22:02:24 +08:00
|
|
|
RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-type.elf 2>&1 | FileCheck %s
|
2015-06-29 22:39:25 +08:00
|
|
|
RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-size.elf 2>&1 | FileCheck %s
|
2016-10-27 19:41:57 +08:00
|
|
|
RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-zero-size.elf 2>&1 | FileCheck %s
|
2015-06-20 04:58:43 +08:00
|
|
|
CHECK: Invalid data was encountered while parsing the file
|
2015-06-29 22:12:14 +08:00
|
|
|
|
2017-10-12 00:56:33 +08:00
|
|
|
RUN: not llvm-dwarfdump %p/Inputs/invalid-bad-rel-type.elf 2>&1 | FileCheck --check-prefix=RELA %s
|
|
|
|
RELA: Section is not SHT_RELA
|
|
|
|
|
2015-06-29 22:12:14 +08:00
|
|
|
RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-non-null.elf 2>&1 | FileCheck --check-prefix=NON-NULL %s
|
2016-11-16 13:10:28 +08:00
|
|
|
NON-NULL: Invalid data was encountered while parsing the file
|
2015-06-30 22:59:20 +08:00
|
|
|
|
|
|
|
Test the sh_entsize are invalid
|
|
|
|
RUN: llvm-readobj -s %p/Inputs/invalid-sh_entsize.elf | FileCheck --check-prefix=SECTION %s
|
|
|
|
|
|
|
|
SECTION: Name: .dynsym
|
|
|
|
SECTION-NEXT: Type: SHT_DYNSYM
|
|
|
|
SECTION-NEXT: Flags [
|
|
|
|
SECTION-NEXT: SHF_ALLOC
|
|
|
|
SECTION-NEXT: ]
|
|
|
|
SECTION-NEXT: Address:
|
|
|
|
SECTION-NEXT: Offset:
|
|
|
|
SECTION-NEXT: Size:
|
|
|
|
SECTION-NEXT: Link:
|
|
|
|
SECTION-NEXT: Info:
|
|
|
|
SECTION-NEXT: AddressAlignment:
|
|
|
|
SECTION-NEXT: EntrySize: 32
|
|
|
|
|
|
|
|
SECTION: Name: .symtab
|
|
|
|
SECTION-NEXT: Type: SHT_SYMTAB
|
|
|
|
SECTION-NEXT: Flags [
|
|
|
|
SECTION-NEXT: ]
|
|
|
|
SECTION-NEXT: Address:
|
|
|
|
SECTION-NEXT: Offset:
|
|
|
|
SECTION-NEXT: Size:
|
|
|
|
SECTION-NEXT: Link:
|
|
|
|
SECTION-NEXT: Info:
|
|
|
|
SECTION-NEXT: AddressAlignment:
|
|
|
|
SECTION-NEXT: EntrySize: 32
|
|
|
|
|
|
|
|
RUN: not llvm-readobj -t %p/Inputs/invalid-sh_entsize.elf 2>&1 | FileCheck --check-prefix=INVALID-SYM-SIZE %s
|
2016-11-16 13:10:28 +08:00
|
|
|
INVALID-SYM-SIZE: invalid sh_entsize
|
2015-07-01 02:23:07 +08:00
|
|
|
|
2016-02-17 23:38:21 +08:00
|
|
|
RUN: not llvm-readobj --dyn-symbols %p/Inputs/invalid-sh_entsize.elf 2>&1 | FileCheck --check-prefix=INVALID-DYNSYM-SIZE %s
|
|
|
|
INVALID-DYNSYM-SIZE: Invalid entity size
|
|
|
|
|
2015-07-01 02:23:07 +08:00
|
|
|
RUN: not llvm-readobj -t %p/Inputs/invalid-section-index.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-INDEX %s
|
2016-11-16 13:10:28 +08:00
|
|
|
INVALID-SECTION-INDEX: invalid section index
|
2015-07-01 03:58:10 +08:00
|
|
|
|
|
|
|
RUN: not llvm-readobj -s %p/Inputs/invalid-section-size.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-SIZE %s
|
2017-10-11 05:21:16 +08:00
|
|
|
INVALID-SECTION-SIZE: invalid section header entry size (e_shentsize) in ELF header
|
2015-07-23 11:24:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
RUN: not llvm-readobj -t %p/Inputs/invalid-symbol-table-size.elf 2>&1 | FileCheck --check-prefix=INVALID-SYMTAB-SIZE %s
|
2016-11-16 13:10:28 +08:00
|
|
|
INVALID-SYMTAB-SIZE: size is not a multiple of sh_entsize
|
2015-08-25 05:09:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
RUN: not llvm-readobj -t %p/Inputs/invalid-xindex-size.elf 2>&1 | FileCheck --check-prefix=INVALID-XINDEX-SIZE %s
|
2017-10-11 05:21:16 +08:00
|
|
|
INVALID-XINDEX-SIZE: invalid section contents size
|
2016-10-04 16:44:03 +08:00
|
|
|
|
2016-10-17 18:58:02 +08:00
|
|
|
RUN: not llvm-readobj -t %p/Inputs/invalid-e_shnum.elf 2>&1 | FileCheck --check-prefix=INVALID-SH-NUM %s
|
2016-11-16 13:10:28 +08:00
|
|
|
INVALID-SH-NUM: invalid e_phentsize
|
2016-10-17 18:58:02 +08:00
|
|
|
|
2016-10-04 16:44:03 +08:00
|
|
|
RUN: not llvm-readobj -t %p/Inputs/invalid-ext-symtab-index.elf-x86-64 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=INVALID-EXT-SYMTAB-INDEX %s
|
2016-11-16 13:10:28 +08:00
|
|
|
INVALID-EXT-SYMTAB-INDEX: index past the end of the symbol table
|
2016-10-04 17:25:39 +08:00
|
|
|
|
|
|
|
RUN: not llvm-readobj -r %p/Inputs/invalid-relocation-sec-sh_offset.elf-i386 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s
|
|
|
|
RUN: not llvm-readobj -r %p/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s
|
2016-11-16 13:10:28 +08:00
|
|
|
INVALID-RELOC-SH-OFFSET: invalid section offset
|
2016-10-17 22:28:12 +08:00
|
|
|
|
2016-10-27 19:44:56 +08:00
|
|
|
RUN: not llvm-readobj -t %p/Inputs/invalid-section-size2.elf 2>&1 | \
|
|
|
|
RUN: FileCheck --check-prefix=INVALID-SECTION-SIZE2 %s
|
2016-11-16 13:10:28 +08:00
|
|
|
INVALID-SECTION-SIZE2: invalid section offset
|
2016-10-31 23:33:00 +08:00
|
|
|
|
|
|
|
RUN: not llvm-readobj -t %p/Inputs/invalid-sections-num.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-NUM %s
|
2017-10-11 05:21:16 +08:00
|
|
|
INVALID-SECTION-NUM: section table goes past the end of file
|
2016-11-04 02:05:33 +08:00
|
|
|
|
|
|
|
RUN: not llvm-readobj -r %p/Inputs/invalid-rel-sym.elf 2>&1 | FileCheck --check-prefix=INVALID-REL-SYM %s
|
2016-11-16 13:10:28 +08:00
|
|
|
INVALID-REL-SYM: invalid section offset
|
2017-10-11 06:17:49 +08:00
|
|
|
|
|
|
|
RUN: not llvm-readobj -r %p/Inputs/invalid-buffer.elf 2>&1 | FileCheck --check-prefix=INVALID-BUFFER %s
|
|
|
|
INVALID-BUFFER: Invalid buffer
|
2017-10-19 09:25:48 +08:00
|
|
|
|
|
|
|
RUN: not llvm-readobj %p/Inputs/invalid-coff-header-too-small 2>&1 | FileCheck --check-prefix=COFF-HEADER %s
|
|
|
|
COFF-HEADER: The file was not recognized as a valid object file
|