From: George Rimar Date: Tue, 23 Apr 2019 14:21:31 +0000 (+0000) Subject: [LLD][ELF] - Remove dynamic-section-sh_size.elf binary, convert test to yaml. NFCI. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb2079b7e13a22bebfba5180114e76a63cc07649;p=platform%2Fupstream%2Fllvm.git [LLD][ELF] - Remove dynamic-section-sh_size.elf binary, convert test to yaml. NFCI. dynamic-section-sh_size.elf was introduced in D25090. Now it is possible to use yaml2obj instead. That is what this patch does. Also I added one more case of a possibly broken .dynamic section just in case. llvm-svn: 358990 --- diff --git a/lld/test/ELF/invalid/Inputs/dynamic-section-sh_size.elf b/lld/test/ELF/invalid/Inputs/dynamic-section-sh_size.elf deleted file mode 100644 index ea35dba..0000000 Binary files a/lld/test/ELF/invalid/Inputs/dynamic-section-sh_size.elf and /dev/null differ diff --git a/lld/test/ELF/invalid/dynamic-section-broken.test b/lld/test/ELF/invalid/dynamic-section-broken.test new file mode 100644 index 0000000..5676e97 --- /dev/null +++ b/lld/test/ELF/invalid/dynamic-section-broken.test @@ -0,0 +1,36 @@ +## .dynamic section has invalid sh_entsize, check we report it. +# RUN: yaml2obj -docnum=1 %s -o %t.so +# RUN: not ld.lld %t.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR1 +# ERR1: error: {{.*}}.so: invalid sh_entsize + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_DYN + Machine: EM_X86_64 +Sections: + - Name: .dynamic + Type: SHT_DYNAMIC + Flags: [ SHF_ALLOC ] + Link: .strtab + EntSize: 0x123 + +## The .dynamic section has invalid sh_size, which is too short and +## even less than entry size. Check we report it. +# RUN: yaml2obj -docnum=2 %s -o %t.so +# RUN: not ld.lld %t.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR2 +# ERR2: error: {{.*}}.so: size is not a multiple of sh_entsize + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_DYN + Machine: EM_X86_64 +Sections: + - Name: .dynamic + Type: SHT_DYNAMIC + Flags: [ SHF_ALLOC ] + Link: .strtab + Content: "00" diff --git a/lld/test/ELF/invalid/dynamic-section-size.s b/lld/test/ELF/invalid/dynamic-section-size.s deleted file mode 100644 index 58a7d06..0000000 --- a/lld/test/ELF/invalid/dynamic-section-size.s +++ /dev/null @@ -1,4 +0,0 @@ -## dynamic-section-sh_size.elf has incorrect sh_size of dynamic section. -# RUN: not ld.lld %p/Inputs/dynamic-section-sh_size.elf -o /dev/null 2>&1 | \ -# RUN: FileCheck %s -# CHECK: error: {{.*}}: invalid sh_entsize