1## For implicit symbol table sections, the `Flags` field can also 2## be specified in YAML. Here we test the behavior in different cases. 3 4## When flags are not explicitly specified, yaml2obj assigns no flags 5## for .symtab and the SHF_ALLOC flag for .dynsym by default. 6 7# RUN: yaml2obj --docnum=1 %s -o %t1 8# RUN: llvm-readobj %t1 -S | FileCheck %s --check-prefix=CASE1 9 10# CASE1: Name: .symtab 11# CASE1-NEXT: Type: SHT_SYMTAB 12# CASE1-NEXT: Flags [ 13# CASE1-NEXT: ] 14# CASE1: Name: .dynsym 15# CASE1-NEXT: Type: SHT_DYNSYM 16# CASE1-NEXT: Flags [ 17# CASE1-NEXT: SHF_ALLOC 18# CASE1-NEXT: ] 19 20--- !ELF 21FileHeader: 22 Class: ELFCLASS64 23 Data: ELFDATA2LSB 24 Type: ET_DYN 25Sections: 26 - Name: .symtab 27 Type: SHT_SYMTAB 28 - Name: .dynsym 29 Type: SHT_DYNSYM 30 31## Check we can set arbitrary flags for .symtab/.dynsym. 32 33# RUN: yaml2obj --docnum=2 %s -o %t2 34# RUN: llvm-readobj %t2 -S | FileCheck %s --check-prefix=CASE2 35 36# CASE2: Name: .symtab 37# CASE2-NEXT: Type: SHT_SYMTAB 38# CASE2-NEXT: Flags [ 39# CASE2-NEXT: SHF_ALLOC 40# CASE2-NEXT: SHF_STRINGS 41# CASE2-NEXT: ] 42# CASE2: Name: .dynsym 43# CASE2-NEXT: Type: SHT_DYNSYM 44# CASE2-NEXT: Flags [ 45# CASE2-NEXT: SHF_STRINGS 46# CASE2-NEXT: ] 47 48--- !ELF 49FileHeader: 50 Class: ELFCLASS64 51 Data: ELFDATA2LSB 52 Type: ET_DYN 53Sections: 54 - Name: .symtab 55 Type: SHT_SYMTAB 56 Flags: [ SHF_ALLOC, SHF_STRINGS ] 57 - Name: .dynsym 58 Type: SHT_DYNSYM 59 Flags: [ SHF_STRINGS ] 60 61## Check no flags are set by default for .symtab when it is not 62## described in the YAML. 63 64# RUN: yaml2obj --docnum=3 %s -o %t3 65# RUN: llvm-readobj %t3 -S | FileCheck %s --check-prefix=CASE3 66 67# CASE3: Name: .symtab 68# CASE3-NEXT: Type: SHT_SYMTAB 69# CASE3-NEXT: Flags [ 70# CASE3-NEXT: ] 71 72--- !ELF 73FileHeader: 74 Class: ELFCLASS64 75 Data: ELFDATA2LSB 76 Type: ET_DYN 77Symbols: [] 78