1# This test intentionally checks for fatal errors, and fatal errors aren't supported for testing when main is run twice. 2# XFAIL: main-run-twice 3## .dynamic section has invalid sh_entsize, check we report it. 4# RUN: yaml2obj --docnum=1 %s -o %t.so 5# RUN: not ld.lld %t.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR1 6# ERR1: error: {{.*}}.so: section [index 1] has invalid sh_entsize: expected 16, but got 291 7 8--- !ELF 9FileHeader: 10 Class: ELFCLASS64 11 Data: ELFDATA2LSB 12 Type: ET_DYN 13 Machine: EM_X86_64 14Sections: 15 - Name: .dynamic 16 Type: SHT_DYNAMIC 17 Flags: [ SHF_ALLOC ] 18 Link: .strtab 19 EntSize: 0x123 20 21## The .dynamic section has invalid sh_size, which is too short and 22## even less than entry size. Check we report it. 23# RUN: yaml2obj --docnum=2 %s -o %t.so 24# RUN: not ld.lld %t.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR2 25# ERR2: error: {{.*}}.so: section [index 1] has an invalid sh_size (1) which is not a multiple of its sh_entsize (16) 26 27--- !ELF 28FileHeader: 29 Class: ELFCLASS64 30 Data: ELFDATA2LSB 31 Type: ET_DYN 32 Machine: EM_X86_64 33Sections: 34 - Name: .dynamic 35 Type: SHT_DYNAMIC 36 Flags: [ SHF_ALLOC ] 37 Link: .strtab 38 Content: "00" 39