1 ## For implicit string table sections, `Size` and/or `Content` fields can also
2 ## be specified in YAML. Here we test the behavior in different cases.
4 ## When no `Size` or `Content` is specified for a string table section,
5 ## yaml2obj writes the default content.
7 # RUN: yaml2obj --docnum=1 %s -o %t1
8 # RUN: llvm-objdump %t1 -s | FileCheck %s --check-prefix=CASE1
10 # CASE1: Contents of section .strtab:
11 # CASE1-NEXT: 0000 00666f6f 00 .foo.
22 ## Used to trigger adding string `foo` to the string table section.
26 ## For string table sections, `Size` can be used to override the
27 ## implicit string table data. The content is filled with zeroes in this case.
29 # RUN: yaml2obj --docnum=2 %s -o %t2
30 # RUN: llvm-readobj --section-data -S %t2 | FileCheck %s --check-prefix=CASE2
32 # CASE2: Name: .strtab
33 # CASE2-NEXT: Type: SHT_STRTAB
36 # CASE2-NEXT: Address: 0x0
37 # CASE2-NEXT: Offset: 0x140
41 # CASE2-NEXT: AddressAlignment: 0
42 # CASE2-NEXT: EntrySize: 0
43 # CASE2-NEXT: SectionData (
44 # CASE2-NEXT: 0000: 0000
57 ## Used to trigger adding string `foo` to the string table section.
61 ## For string table sections, `Content` can be used to override the
62 ## implicit string table data.
64 # RUN: yaml2obj --docnum=3 %s -o %t3
65 # RUN: llvm-readobj --section-data -S %t3 | FileCheck %s --check-prefix=CASE3
67 # CASE3: Name: .strtab
68 # CASE3-NEXT: Type: SHT_STRTAB
71 # CASE3-NEXT: Address: 0x0
72 # CASE3-NEXT: Offset: 0x140
76 # CASE3-NEXT: AddressAlignment: 0
77 # CASE3-NEXT: EntrySize: 0
78 # CASE3-NEXT: SectionData (
79 # CASE3-NEXT: 0000: 0102
92 ## Used to trigger adding string `foo` to the string table section.
96 ## For string table sections, check we can specify both `Size` and `Content`
97 ## when size is greater than content size. In this case zeroes are
98 ## added as padding after the specified content.
100 # RUN: yaml2obj --docnum=4 %s -o %t4
101 # RUN: llvm-readobj --section-data -S %t4 | FileCheck %s --check-prefix=CASE4
103 # CASE4: Name: .strtab
104 # CASE4-NEXT: Type: SHT_STRTAB
105 # CASE4-NEXT: Flags [
107 # CASE4-NEXT: Address: 0x0
108 # CASE4-NEXT: Offset: 0x140
109 # CASE4-NEXT: Size: 3
110 # CASE4-NEXT: Link: 0
111 # CASE4-NEXT: Info: 0
112 # CASE4-NEXT: AddressAlignment: 0
113 # CASE4-NEXT: EntrySize: 0
114 # CASE4-NEXT: SectionData (
115 # CASE4-NEXT: 0000: 010200
129 ## Used to trigger adding string `foo` to the string table section.
133 ## For string table sections, check we can specify both `Size` and `Content`
134 ## when size is equal to content size.
136 # RUN: yaml2obj --docnum=5 %s -o %t5
137 # RUN: llvm-readobj --section-data -S %t5 | FileCheck %s --check-prefix=CASE5
139 # CASE5: Name: .strtab
140 # CASE5-NEXT: Type: SHT_STRTAB
141 # CASE5-NEXT: Flags [ (0x0)
143 # CASE5-NEXT: Address: 0x0
144 # CASE5-NEXT: Offset: 0x140
145 # CASE5-NEXT: Size: 2
146 # CASE5-NEXT: Link: 0
147 # CASE5-NEXT: Info: 0
148 # CASE5-NEXT: AddressAlignment: 0
149 # CASE5-NEXT: EntrySize: 0
150 # CASE5-NEXT: SectionData (
151 # CASE5-NEXT: 0000: 0102
165 ## Used to trigger adding string `foo` to the string table section.