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
--- /dev/null
+## .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"
+++ /dev/null
-## 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