From 2915b3988f4445244c3c09414500232b3ccaa416 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Tue, 2 Jul 2019 10:30:06 +0000 Subject: [PATCH] [Object/invalid.test] - Convert 3 more sub-tests to YAML This allows to remove 3 more precompiled binaries from the inputs. Differential revision: https://reviews.llvm.org/D63880 llvm-svn: 364903 --- .../invalid-relocation-sec-sh_offset.elf-i386 | Bin 358 -> 0 bytes .../invalid-relocation-sec-sh_offset.elf-x86-64 | Bin 543 -> 0 bytes llvm/test/Object/Inputs/invalid-section-size2.elf | Bin 938 -> 0 bytes llvm/test/Object/invalid.test | 53 +++++++++++++++++---- 4 files changed, 43 insertions(+), 10 deletions(-) delete mode 100644 llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386 delete mode 100644 llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64 delete mode 100644 llvm/test/Object/Inputs/invalid-section-size2.elf diff --git a/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386 b/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386 deleted file mode 100644 index 84fcd0d1d006794b1b36814c1cebfd5529b832eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 358 zcmah?F%H5&49iidKwVfE*+61CG4KF7l!;G(REYtW_6C@E`eCcJ$W}{M;>1qA&GiyO zFd-$cXInxSpgh!Da0UuTEY}dcNgqAb w8<1JyjHT{yroKY&eKi()g`AHgX8do?2E?v?#?-!(#s1N!F5T|vR6j53AO61+6#xJL diff --git a/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64 b/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64 deleted file mode 100644 index aae6c1e9c1c0cf85386544c403dc73379db39769..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 543 zcmb<-^>JfjWMqH=Mg}_u1P><4z~F#jLfH-sYz(YOqU15zfZ9OzfoNoK0O|-9WI-Ss z-EAN~x*Cv{|NsAkC=T)#N~kEOi(q*)B~tum^zRhAR!K@BAB=skPk8& z9sGdmN468B2A$6X6vL+fCsd&tn!)J$kavaT)m>yoJ75n)QS=Yz2c1GlA@Bt MBp?e$SLTBF0QN){&Hw-a diff --git a/llvm/test/Object/Inputs/invalid-section-size2.elf b/llvm/test/Object/Inputs/invalid-section-size2.elf deleted file mode 100644 index 5b7b5bca48aed978f3cd2417d71f1644fab6ff0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 938 zcmb<-^>JflWMqH=W(H;k1doBi1S$ccH5k|!SYb*D(n>%TAhXz@D&3eE7+8>W{RaXN zR~m?s)nziHs#AtKNEoONXapP-0M!Wqc_1@EN;rTR#ODTLpcEW5069=2z+x~qh(=b| z$o&8RHL!~yT4Czo28}XCLxAcbpjVtxTvAk$n8ct5rz>;8{F2m)5+epZ5M{^!0H;M7 AB>(^b diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test index 112364a..8c7a1d9 100644 --- a/llvm/test/Object/invalid.test +++ b/llvm/test/Object/invalid.test @@ -240,26 +240,59 @@ Sections: ## Check that llvm-readobj reports an error if a relocation section ## has a broken sh_offset (past the end of the file). -# 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 +# RUN: yaml2obj %s --docnum=12 -o %t12 +# RUN: yaml2obj %s --docnum=13 -o %t12 +# RUN: not llvm-readobj -r %t12 2>&1 | FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s +# RUN: not llvm-readobj -r %t13 2>&1 | FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s # INVALID-RELOC-SH-OFFSET: invalid section offset +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_386 +Sections: + - Name: .rel + Type: SHT_REL + ShOffset: 0x10000 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: + - Name: .rela + Type: SHT_RELA + ShOffset: 0x10000 + ## Check that llvm-objdump reports an error when .shstrtab has a broken sh_offset ## so large that sh_offset + sh_size overflows the platform address size type. -# RUN: not llvm-readobj --symbols %p/Inputs/invalid-section-size2.elf 2>&1 | \ -# RUN: FileCheck --check-prefix=INVALID-SECTION-SIZE2 %s +# RUN: yaml2obj %s --docnum=14 -o %t14 +# RUN: not llvm-readobj --symbols %t14 2>&1 | FileCheck --check-prefix=INVALID-SECTION-SIZE2 %s # INVALID-SECTION-SIZE2: invalid section offset +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_386 +Sections: + - Name: .shstrtab + Type: SHT_STRTAB + ShOffset: 0xFFFFFFFF + ## Check that llvm-readobj reports an error when trying to dump sections ## when the e_shnum field is broken (is greater than the actual number of sections). -# RUN: yaml2obj %s --docnum=12 -o %t12 -# RUN: not llvm-readobj -S %t12 2>&1 | FileCheck --check-prefix=INVALID-SECTION-NUM %s +# RUN: yaml2obj %s --docnum=15 -o %t15 +# RUN: not llvm-readobj -S %t15 2>&1 | FileCheck --check-prefix=INVALID-SECTION-NUM %s # INVALID-SECTION-NUM: section table goes past the end of file @@ -274,8 +307,8 @@ FileHeader: ## Check that llvm-readobj reports an error if a relocation contains an ## incorrect (too large) symbol index. -# RUN: yaml2obj %s --docnum=13 -o %t13 -# RUN: not llvm-readobj -r %t13 2>&1 | FileCheck --check-prefix=INVALID-REL-SYM %s +# RUN: yaml2obj %s --docnum=16 -o %t16 +# RUN: not llvm-readobj -r %t16 2>&1 | FileCheck --check-prefix=INVALID-REL-SYM %s # INVALID-REL-SYM: invalid section offset -- 2.7.4