X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FObject%2Fcorrupt.test;h=05a8d0fab5c4bfaf921db042329dffdb53747af2;hb=c136e5507a3f3d0a35e83c9db99c6081735aa5a0;hp=41c7a9ff6c39933d78e408a45b3b5f70eb94d57d;hpb=d60ced8e086559b48d03e8392b2e9fe964a8fcf6;p=oota-llvm.git diff --git a/test/Object/corrupt.test b/test/Object/corrupt.test index 41c7a9ff6c3..05a8d0fab5c 100644 --- a/test/Object/corrupt.test +++ b/test/Object/corrupt.test @@ -2,22 +2,57 @@ RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections \ RUN: 2>&1 | FileCheck --check-prefix=SECNAME %s +SECNAME: Error reading file: Invalid data was encountered while parsing the file. + + // 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: Error reading file: Invalid data was encountered while parsing the file. + + // 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: Error reading file: Invalid data was encountered while parsing the file. + + // 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 -SECNAME: Error reading file: Invalid data was encountered while parsing the file. +VER: Error reading file: Invalid data was encountered while parsing the file. -SECDATA: Error reading file: Invalid data was encountered while parsing the file. -SYMNAME: Error reading file: Invalid data was encountered while parsing the file. +// 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 -VER: Error reading file: Invalid data was encountered while parsing the file. +STRTAB: Invalid dynamic string table reference + +RUN: not llvm-readobj -program-headers \ +RUN: %p/Inputs/corrupt-invalid-phentsize.elf.x86-64 2>&1 | \ +RUN: FileCheck --check-prefix=PHENTSIZE %s + +PHENTSIZE: Invalid program header size + +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 + + +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 relocation entry 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 dynamic table size