xref: /llvm-project/llvm/test/tools/yaml2obj/ELF/implicit-sections-types.yaml (revision a6436b0b3a7fd9f13d7a059a6a78544a7e0b702f)
1## Here we check the types set for implicit sections
2## in different cases.
3
4## Check the types set by default in case sections were implicitly
5## added and not described in the YAML.
6
7# RUN: yaml2obj --docnum=1 %s -o %t1
8# RUN: llvm-readobj -S %t1 | FileCheck %s --check-prefix=CASE1
9
10# CASE1:      Name: .dynsym
11# CASE1-NEXT: Type: SHT_DYNSYM
12# CASE1:      Name: .dynstr
13# CASE1-NEXT: Type: SHT_STRTAB
14# CASE1:      Name: .symtab
15# CASE1-NEXT: Type: SHT_SYMTAB
16# CASE1:      Name: .strtab
17# CASE1-NEXT: Type: SHT_STRTAB
18# CASE1:      Name: .shstrtab
19# CASE1-NEXT: Type: SHT_STRTAB
20
21--- !ELF
22FileHeader:
23  Class: ELFCLASS64
24  Data:  ELFDATA2LSB
25  Type:  ET_DYN
26## Needed to force the creation of the .symtab.
27Symbols: []
28## Needed to force the creation of the .dynsym and .dynstr.
29DynamicSymbols: []
30
31## Check we can set any arbitrary types when describing sections
32## that are usually implicit.
33
34# RUN: yaml2obj --docnum=2 %s -o %t2
35# RUN: llvm-readobj -S %t2 | FileCheck %s --check-prefix=CASE2
36
37# CASE2:      Name: .symtab
38# CASE2-NEXT: Type: SHT_DYNAMIC
39# CASE2:      Name: .strtab
40# CASE2-NEXT: Type: SHT_RELA
41# CASE2:      Name: .shstrtab
42# CASE2-NEXT: Type: SHT_PROGBITS
43# CASE2:      Name: .dynsym
44# CASE2-NEXT: Type: SHT_NOTE
45# CASE2:      Name: .dynstr
46# CASE2-NEXT: Type: SHT_NOBITS
47
48--- !ELF
49FileHeader:
50  Class: ELFCLASS64
51  Data:  ELFDATA2LSB
52  Type:  ET_DYN
53Sections:
54  - Name: .symtab
55    Type: SHT_DYNAMIC
56  - Name: .strtab
57    Type: SHT_RELA
58  - Name: .shstrtab
59    Type: SHT_PROGBITS
60  - Name: .dynsym
61    Type: SHT_NOTE
62    Size: 0
63  - Name: .dynstr
64    Type: SHT_NOBITS
65## Needed to set the proper content size for .symtab, so
66## that llvm-readobj can dump this section.
67Symbols:
68  - Name: foo
69