1 ## For implicit dynamic symbol table sections, `Size` and/or `Content`
2 ## fields can also be specified in YAML. Here we test the behavior in
5 ## When no `Size` or `Content` is specified for a dynamic symbol table section,
6 ## yaml2obj writes the default content.
8 # RUN: yaml2obj --docnum=1 %s -o %t1
9 # RUN: llvm-readelf %t1 --dyn-symbols | FileCheck %s --check-prefix=CASE1
11 # CASE1: Symbol table '.dynsym' contains 2 entries:
12 # CASE1-NEXT: Num: Value Size Type Bind Vis Ndx Name
13 # CASE1-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
14 # CASE1-NEXT: 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND foo
30 ## Specifying both `Size` and symbols at the same time is not allowed for .dynsym.
32 # RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --implicit-check-not=error --check-prefix=CASE2
34 # CASE2: yaml2obj: error: cannot specify both `Size` and `DynamicSymbols` for symbol table section '.dynsym'
53 ## Specifying both `Content` and symbols at the same time is not allowed for .dynsym.
55 # RUN: not yaml2obj --docnum=3 %s 2>&1 | FileCheck %s --implicit-check-not=error --check-prefix=CASE3
57 # CASE3: yaml2obj: error: cannot specify both `Content` and `DynamicSymbols` for symbol table section '.dynsym'
76 ## Check we can use just `Content` to emit custom data in the symbol table section.
77 # RUN: yaml2obj --docnum=4 %s -o %t4
78 # RUN: llvm-readobj --section-data -S %t4 | FileCheck %s --check-prefix=CASE4
80 # CASE4: Name: .dynsym
81 # CASE4-NEXT: Type: SHT_DYNSYM
83 # CASE4-NEXT: SHF_ALLOC
85 # CASE4-NEXT: Address: 0x0
86 # CASE4-NEXT: Offset: 0x40
90 # CASE4-NEXT: AddressAlignment: 0
91 # CASE4-NEXT: EntrySize: 24
92 # CASE4-NEXT: SectionData (
93 # CASE4-NEXT: 0000: 0123
107 ## Check we can use just `Size` to emit custom data filled with zeroes
108 ## in the symbol table section.
109 # RUN: yaml2obj --docnum=5 %s -o %t5
110 # RUN: llvm-readobj --section-data -S %t5 | FileCheck %s --check-prefix=CASE5
112 # CASE5: Name: .dynsym
113 # CASE5-NEXT: Type: SHT_DYNSYM
114 # CASE5-NEXT: Flags [
115 # CASE5-NEXT: SHF_ALLOC
117 # CASE5-NEXT: Address: 0x0
118 # CASE5-NEXT: Offset: 0x40
119 # CASE5-NEXT: Size: 5
120 # CASE5-NEXT: Link: 0
121 # CASE5-NEXT: Info: 1
122 # CASE5-NEXT: AddressAlignment: 0
123 # CASE5-NEXT: EntrySize: 24
124 # CASE5-NEXT: SectionData (
125 # CASE5-NEXT: 0000: 00000000 00
139 ## Check we can specify both `Size` and `Content` when size is greater
140 ## than content size. In this case zeroes are added as padding
141 ## after after the specified content.
143 # RUN: yaml2obj --docnum=6 %s -o %t6
144 # RUN: llvm-readobj %t6 --section-data -S | FileCheck %s --check-prefix=CASE6
146 # CASE6: Name: .dynsym
147 # CASE6-NEXT: Type: SHT_DYNSYM
148 # CASE6-NEXT: Flags [
149 # CASE6-NEXT: SHF_ALLOC
151 # CASE6-NEXT: Address: 0x0
152 # CASE6-NEXT: Offset: 0x40
153 # CASE6-NEXT: Size: 4
154 # CASE6-NEXT: Link: 0
155 # CASE6-NEXT: Info: 1
156 # CASE6-NEXT: AddressAlignment: 0
157 # CASE6-NEXT: EntrySize: 24
158 # CASE6-NEXT: SectionData (
159 # CASE6-NEXT: 0000: 01230000
174 ## Check we can specify both `Size` and `Content` when size is
175 ## equal to content size.
177 # RUN: yaml2obj --docnum=7 %s -o %t7
178 # RUN: llvm-readobj --section-data -S %t7 | FileCheck %s --check-prefix=CASE7
180 # CASE7: Name: .dynsym
181 # CASE7-NEXT: Type: SHT_DYNSYM
182 # CASE7-NEXT: Flags [
183 # CASE7-NEXT: SHF_ALLOC
185 # CASE7-NEXT: Address: 0x0
186 # CASE7-NEXT: Offset: 0x40
187 # CASE7-NEXT: Size: 2
188 # CASE7-NEXT: Link: 0
189 # CASE7-NEXT: Info: 1
190 # CASE7-NEXT: AddressAlignment: 0
191 # CASE7-NEXT: EntrySize: 24
192 # CASE7-NEXT: SectionData (
193 # CASE7-NEXT: 0000: 0123