1 ## Check that llvm-readelf and llvm-readobj can
2 ## dump SHT_GROUP sections properly.
4 # RUN: yaml2obj %s -o %t.o
5 # RUN: llvm-readobj -g %t.o | FileCheck %s
6 # RUN: llvm-readobj --elf-section-groups %t.o | FileCheck %s
7 # RUN: llvm-readobj --elf-section-groups %t.o --elf-output-style=JSON --pretty-print | FileCheck %s --check-prefix=JSON
8 # RUN: llvm-readelf -g %t.o | FileCheck --check-prefix=GNU %s
12 # CHECK-NEXT: Name: .group
13 # CHECK-NEXT: Index: 1
16 # CHECK-NEXT: Type: COMDAT
17 # CHECK-NEXT: Signature: foo
18 # CHECK-NEXT: Section(s) in group [
19 # CHECK-NEXT: .text.foo
20 # CHECK-NEXT: .rela.text.foo
24 # CHECK-NEXT: Name: .group1
25 # CHECK-NEXT: Index: 2
28 # CHECK-NEXT: Type: COMDAT
29 # CHECK-NEXT: Signature: bar
30 # CHECK-NEXT: Section(s) in group [
31 # CHECK-NEXT: .text.bar
32 # CHECK-NEXT: .rela.text.bar
36 # GNU: COMDAT group section [ 1] `.group' [foo] contains 2 sections:
37 # GNU-NEXT: [Index] Name
38 # GNU-NEXT: [ 3] .text.foo
39 # GNU-NEXT: [ 4] .rela.text.foo
40 # GNU: COMDAT group section [ 2] `.group1' [bar] contains 2 sections:
41 # GNU-NEXT: [Index] Name
42 # GNU-NEXT: [ 5] .text.bar
43 # GNU-NEXT: [ 6] .rela.text.bar
46 # JSON-NEXT: "Group": {
47 # JSON-NEXT: "Name": {
48 # JSON-NEXT: "Name": ".group",
49 # JSON-NEXT: "Value": 16
51 # JSON-NEXT: "Index": 1,
52 # JSON-NEXT: "Link": 7,
53 # JSON-NEXT: "Info": 1,
54 # JSON-NEXT: "Type": {
55 # JSON-NEXT: "Name": "COMDAT",
56 # JSON-NEXT: "Value": 1
58 # JSON-NEXT: "Signature": "foo",
59 # JSON-NEXT: "GroupSections": [
61 # JSON-NEXT: "Name": ".text.foo",
62 # JSON-NEXT: "Index": 3
65 # JSON-NEXT: "Name": ".rela.text.foo",
66 # JSON-NEXT: "Index": 4
70 # JSON-NEXT: "Group": {
71 # JSON-NEXT: "Name": {
72 # JSON-NEXT: "Name": ".group1",
73 # JSON-NEXT: "Value": 64
75 # JSON-NEXT: "Index": 2,
76 # JSON-NEXT: "Link": 7,
77 # JSON-NEXT: "Info": 2,
78 # JSON-NEXT: "Type": {
79 # JSON-NEXT: "Name": "COMDAT",
80 # JSON-NEXT: "Value": 1
82 # JSON-NEXT: "Signature": "bar",
83 # JSON-NEXT: "GroupSections": [
85 # JSON-NEXT: "Name": ".text.bar",
86 # JSON-NEXT: "Index": 5
89 # JSON-NEXT: "Name": ".rela.text.bar",
90 # JSON-NEXT: "Index": 6
104 Link: [[SYMTAB1=.symtab]]
107 - SectionOrType: GRP_COMDAT
108 - SectionOrType: .text.foo
109 - SectionOrType: [[MEMBER1=.rela.text.foo]]
110 ShSize: [[SECSIZE1=<none>]]
111 ShName: [[GROUP1SHNAME=<none>]]
114 Link: [[SYMTAB2=.symtab]]
117 - SectionOrType: GRP_COMDAT
118 - SectionOrType: [[MEMBER2=.text.bar]]
119 - SectionOrType: .rela.text.bar
120 ShSize: [[SECSIZE2=<none>]]
123 - Name: .rela.text.foo
129 ShName: [[TEXTBARSHNAME=<none>]]
130 - Name: .rela.text.bar
136 Link: [[SYMTABLINK=.strtab]]
139 Content: [[STRTABCONTENT=<none>]]
143 StName: [[SYM1STNAME=<none>]]
146 StName: [[SYM2STNAME=<none>]]
148 ## Check that we report a warning and continue dumping when a section is included
149 ## in two group sections at the same time.
151 # RUN: yaml2obj %s -DMEMBER2=.text.foo -o %t.dup.o
152 # RUN: llvm-readobj --section-groups %t.dup.o 2>&1 | FileCheck %s -DFILE=%t.dup.o --check-prefix=DUP-LLVM
153 # RUN: llvm-readelf --section-groups %t.dup.o 2>&1 | FileCheck %s -DFILE=%t.dup.o --check-prefix=DUP-GNU
156 # DUP-LLVM-NEXT: Name: .group
157 # DUP-LLVM-NEXT: Index: 1
158 # DUP-LLVM-NEXT: Link: 7
159 # DUP-LLVM-NEXT: Info: 1
160 # DUP-LLVM-NEXT: Type: COMDAT
161 # DUP-LLVM-NEXT: Signature: foo
162 # DUP-LLVM-NEXT: Section(s) in group [
163 # DUP-LLVM-NEXT: .text.foo (3)
164 # DUP-LLVM-NEXT: .rela.text.foo (4)
168 # DUP-LLVM-NEXT: Name: .group1
169 # DUP-LLVM-NEXT: Index: 2
170 # DUP-LLVM-NEXT: Link: 7
171 # DUP-LLVM-NEXT: Info: 2
172 # DUP-LLVM-NEXT: Type: COMDAT
173 # DUP-LLVM-NEXT: Signature: bar
174 # DUP-LLVM-NEXT: Section(s) in group [
175 # DUP-LLVM-NEXT: warning: '[[FILE]]': section with index 3, included in the group section with index 1, was also found in the group section with index 2
176 # DUP-LLVM-NEXT: .text.foo (3)
177 # DUP-LLVM-NEXT: .rela.text.bar (6)
181 # DUP-GNU: COMDAT group section [ 1] `.group' [foo] contains 2 sections:
182 # DUP-GNU-NEXT: [Index] Name
183 # DUP-GNU-NEXT: [ 3] .text.foo
184 # DUP-GNU-NEXT: [ 4] .rela.text.foo
186 # DUP-GNU: COMDAT group section [ 2] `.group1' [bar] contains 2 sections:
187 # DUP-GNU-NEXT: [Index] Name
188 # DUP-GNU-NEXT: warning: '[[FILE]]': section with index 3, included in the group section with index 1, was also found in the group section with index 2
189 # DUP-GNU-NEXT: [ 3] .text.foo
190 # DUP-GNU-NEXT: [ 6] .rela.text.bar
192 ## Check what we do when we are unable to dump the signature symbol name.
193 ## In this case the index of the string table section, linked to the symbol table used by a group section,
194 ## is broken (section does not exist).
195 ## Check we report a warning in this case. Check we don't print the same warning message twice.
197 # RUN: yaml2obj %s -DSYMTABLINK=0xFF -o %t.symtab.o
198 # RUN: llvm-readobj --section-groups %t.symtab.o 2>&1 | \
199 # RUN: FileCheck -DFILE=%t.symtab.o %s --check-prefix=SYMTAB-LLVM --implicit-check-not=warning:
200 # RUN: llvm-readelf --section-groups %t.symtab.o 2>&1 | \
201 # RUN: FileCheck -DFILE=%t.symtab.o %s --check-prefix=SYMTAB-GNU --implicit-check-not=warning:
203 # SYMTAB-LLVM: Groups {
204 # SYMTAB-LLVM-NEXT: warning: '[[FILE]]': unable to get the string table for SHT_SYMTAB section with index 7: invalid section index: 255
205 # SYMTAB-LLVM-NEXT: Group {
206 # SYMTAB-LLVM-NEXT: Name: .group (16)
207 # SYMTAB-LLVM-NEXT: Index: 1
208 # SYMTAB-LLVM-NEXT: Link: 7
209 # SYMTAB-LLVM-NEXT: Info: 1
210 # SYMTAB-LLVM-NEXT: Type: COMDAT (0x1)
211 # SYMTAB-LLVM-NEXT: Signature: <?>
212 # SYMTAB-LLVM-NEXT: Section(s) in group [
213 # SYMTAB-LLVM-NEXT: .text.foo (3)
214 # SYMTAB-LLVM-NEXT: .rela.text.foo (4)
215 # SYMTAB-LLVM-NEXT: ]
216 # SYMTAB-LLVM-NEXT: }
217 # SYMTAB-LLVM-NEXT: Group {
218 # SYMTAB-LLVM-NEXT: Name: .group1 (64)
219 # SYMTAB-LLVM-NEXT: Index: 2
220 # SYMTAB-LLVM-NEXT: Link: 7
221 # SYMTAB-LLVM-NEXT: Info: 2
222 # SYMTAB-LLVM-NEXT: Type: COMDAT (0x1)
223 # SYMTAB-LLVM-NEXT: Signature: <?>
224 # SYMTAB-LLVM-NEXT: Section(s) in group [
225 # SYMTAB-LLVM-NEXT: .text.bar (5)
226 # SYMTAB-LLVM-NEXT: .rela.text.bar (6)
227 # SYMTAB-LLVM-NEXT: ]
228 # SYMTAB-LLVM-NEXT: }
229 # SYMTAB-LLVM-NEXT: }
231 # SYMTAB-GNU: warning: '[[FILE]]': unable to get the string table for SHT_SYMTAB section with index 7: invalid section index: 255
233 # SYMTAB-GNU-NEXT: COMDAT group section [ 1] `.group' [<?>] contains 2 sections:
234 # SYMTAB-GNU-NEXT: [Index] Name
235 # SYMTAB-GNU-NEXT: [ 3] .text.foo
236 # SYMTAB-GNU-NEXT: [ 4] .rela.text.foo
238 # SYMTAB-GNU-NEXT: COMDAT group section [ 2] `.group1' [<?>] contains 2 sections:
239 # SYMTAB-GNU-NEXT: [Index] Name
240 # SYMTAB-GNU-NEXT: [ 5] .text.bar
241 # SYMTAB-GNU-NEXT: [ 6] .rela.text.bar
243 ## This tests the behavior for two more cases when we are unable to dump the signature symbol name.
244 ## In the first case we link the group section to the section with index 255, which does not exist.
245 ## We check that a warning is reported when we are unable to locate the symbol table.
246 ## In the second case we link the SHT_GROUP section to itself. This documents that we don't check the
247 ## type of the linked section (we assume it is the symbol table) and checks that we report a warning
248 ## when we are unable to read a signature symbol.
250 # RUN: yaml2obj %s -DSYMTAB1=0xFF -DSYMTAB2=0x1 -o %t.symtab2.o
251 # RUN: llvm-readobj --section-groups %t.symtab2.o 2>&1 | \
252 # RUN: FileCheck -DFILE=%t.symtab2.o %s --check-prefix=SIGNATURE-LLVM --implicit-check-not=warning:
253 # RUN: llvm-readelf --section-groups %t.symtab2.o 2>&1 | \
254 # RUN: FileCheck -DFILE=%t.symtab2.o %s --check-prefix=SIGNATURE-GNU --implicit-check-not=warning:
256 # SIGNATURE: Groups {
257 # SIGNATURE-LLVM: warning: '[[FILE]]': unable to get the symbol table for SHT_GROUP section with index 1: invalid section index: 255
258 # SIGNATURE-LLVM: warning: '[[FILE]]': unable to get the signature symbol for SHT_GROUP section with index 2: section [index 1] has invalid sh_entsize: expected 24, but got 4
259 # SIGNATURE-LLVM: Group {
260 # SIGNATURE-LLVM: Name: .group (16)
261 # SIGNATURE-LLVM: Index: 1
262 # SIGNATURE-LLVM: Link: 255
263 # SIGNATURE-LLVM: Info: 1
264 # SIGNATURE-LLVM: Type: COMDAT (0x1)
265 # SIGNATURE-LLVM: Signature: <?>
266 # SIGNATURE-LLVM: Section(s) in group [
267 # SIGNATURE-LLVM: .text.foo (3)
268 # SIGNATURE-LLVM: .rela.text.foo (4)
271 # SIGNATURE-LLVM: Group {
272 # SIGNATURE-LLVM: Name: .group1 (64)
273 # SIGNATURE-LLVM: Index: 2
274 # SIGNATURE-LLVM: Link: 1
275 # SIGNATURE-LLVM: Info: 2
276 # SIGNATURE-LLVM: Type: COMDAT (0x1)
277 # SIGNATURE-LLVM: Signature: <?>
278 # SIGNATURE-LLVM: Section(s) in group [
279 # SIGNATURE-LLVM: .text.bar (5)
280 # SIGNATURE-LLVM: .rela.text.bar (6)
285 # SIGNATURE-GNU: warning: '[[FILE]]': unable to get the symbol table for SHT_GROUP section with index 1: invalid section index: 255
286 # SIGNATURE-GNU-NEXT: warning: '[[FILE]]': unable to get the signature symbol for SHT_GROUP section with index 2: section [index 1] has invalid sh_entsize: expected 24, but got 4
287 # SIGNATURE-GNU-EMPTY:
288 # SIGNATURE-GNU-NEXT: COMDAT group section [ 1] `.group' [<?>] contains 2 sections:
289 # SIGNATURE-GNU-NEXT: [Index] Name
290 # SIGNATURE-GNU-NEXT: [ 3] .text.foo
291 # SIGNATURE-GNU-NEXT: [ 4] .rela.text.foo
292 # SIGNATURE-GNU-EMPTY:
293 # SIGNATURE-GNU-NEXT: COMDAT group section [ 2] `.group1' [<?>] contains 2 sections:
294 # SIGNATURE-GNU-NEXT: [Index] Name
295 # SIGNATURE-GNU-NEXT: [ 5] .text.bar
296 # SIGNATURE-GNU-NEXT: [ 6] .rela.text.bar
298 ## Check we report a warning when the content of the group section is empty or can't be read.
299 ## In both cases we are unable to read the section group flag and dump it as 0.
301 # RUN: yaml2obj %s -DSECSIZE1=0x0 -DSECSIZE2=0x1 -o %t.secsize.o
302 # RUN: llvm-readobj --section-groups %t.secsize.o 2>&1 | \
303 # RUN: FileCheck -DFILE=%t.secsize.o %s --check-prefix=CONTENT-LLVM --implicit-check-not=warning:
304 # RUN: llvm-readelf --section-groups %t.secsize.o 2>&1 | \
305 # RUN: FileCheck -DFILE=%t.secsize.o %s --check-prefix=CONTENT-GNU --implicit-check-not=warning:
307 # CONTENT-LLVM: Groups {
308 # CONTENT-LLVM-NEXT: warning: '[[FILE]]': unable to read the section group flag from the SHT_GROUP section with index 1: the section is empty
309 # CONTENT-LLVM-NEXT: warning: '[[FILE]]': unable to get the content of the SHT_GROUP section with index 2: section [index 2] has an invalid sh_size (1) which is not a multiple of its sh_entsize (4)
310 # CONTENT-LLVM-NEXT: Group {
311 # CONTENT-LLVM-NEXT: Name: .group (16)
312 # CONTENT-LLVM-NEXT: Index: 1
313 # CONTENT-LLVM-NEXT: Link: 7
314 # CONTENT-LLVM-NEXT: Info: 1
315 # CONTENT-LLVM-NEXT: Type: (unknown) (0x0)
316 # CONTENT-LLVM-NEXT: Signature: foo
317 # CONTENT-LLVM-NEXT: Section(s) in group [
318 # CONTENT-LLVM-NEXT: ]
319 # CONTENT-LLVM-NEXT: }
320 # CONTENT-LLVM-NEXT: Group {
321 # CONTENT-LLVM-NEXT: Name: .group1 (64)
322 # CONTENT-LLVM-NEXT: Index: 2
323 # CONTENT-LLVM-NEXT: Link: 7
324 # CONTENT-LLVM-NEXT: Info: 2
325 # CONTENT-LLVM-NEXT: Type: (unknown) (0x0)
326 # CONTENT-LLVM-NEXT: Signature: bar
327 # CONTENT-LLVM-NEXT: Section(s) in group [
328 # CONTENT-LLVM-NEXT: ]
329 # CONTENT-LLVM-NEXT: }
330 # CONTENT-LLVM-NEXT: }
332 # CONTENT-GNU: warning: '[[FILE]]': unable to read the section group flag from the SHT_GROUP section with index 1: the section is empty
333 # CONTENT-GNU: warning: '[[FILE]]': unable to get the content of the SHT_GROUP section with index 2: section [index 2] has an invalid sh_size (1) which is not a multiple of its sh_entsize (4)
335 # CONTENT-GNU-NEXT: (unknown) group section [ 1] `.group' [foo] contains 0 sections:
336 # CONTENT-GNU-NEXT: [Index] Name
338 # CONTENT-GNU-NEXT: (unknown) group section [ 2] `.group1' [bar] contains 0 sections:
339 # CONTENT-GNU-NEXT: [Index] Name
341 ## Check that we emit a warning when we are unable to read the group section name or the name of a member.
343 # RUN: yaml2obj %s -DGROUP1SHNAME=0xAAAA -DTEXTBARSHNAME=0xBBBB -o %t.name.o
344 # RUN: llvm-readobj --section-groups %t.name.o 2>&1 | \
345 # RUN: FileCheck -DFILE=%t.name.o %s --check-prefix=NAME-LLVM --implicit-check-not=warning:
346 # RUN: llvm-readelf --section-groups %t.name.o 2>&1 | \
347 # RUN: FileCheck -DFILE=%t.name.o %s --check-prefix=NAME-GNU --implicit-check-not=warning:
349 # NAME-LLVM: Groups {
350 # NAME-LLVM-NEXT: warning: '[[FILE]]': unable to get the name of SHT_GROUP section with index 1: a section [index 1] has an invalid sh_name (0xaaaa) offset which goes past the end of the section name string table
351 # NAME-LLVM-NEXT: warning: '[[FILE]]': unable to get the name of SHT_PROGBITS section with index 5: a section [index 5] has an invalid sh_name (0xbbbb) offset which goes past the end of the section name string table
352 # NAME-LLVM-NEXT: Group {
353 # NAME-LLVM-NEXT: Name: <?> (43690)
354 # NAME-LLVM-NEXT: Index: 1
355 # NAME-LLVM-NEXT: Link: 7
356 # NAME-LLVM-NEXT: Info: 1
357 # NAME-LLVM-NEXT: Type: COMDAT (0x1)
358 # NAME-LLVM-NEXT: Signature: foo
359 # NAME-LLVM-NEXT: Section(s) in group [
360 # NAME-LLVM-NEXT: .text.foo (3)
361 # NAME-LLVM-NEXT: .rela.text.foo (4)
364 # NAME-LLVM-NEXT: Group {
365 # NAME-LLVM-NEXT: Name: .group1 (64)
366 # NAME-LLVM-NEXT: Index: 2
367 # NAME-LLVM-NEXT: Link: 7
368 # NAME-LLVM-NEXT: Info: 2
369 # NAME-LLVM-NEXT: Type: COMDAT (0x1)
370 # NAME-LLVM-NEXT: Signature: bar
371 # NAME-LLVM-NEXT: Section(s) in group [
372 # NAME-LLVM-NEXT: <?> (5)
373 # NAME-LLVM-NEXT: .rela.text.bar (6)
378 # NAME-GNU: warning: '[[FILE]]': unable to get the name of SHT_GROUP section with index 1: a section [index 1] has an invalid sh_name (0xaaaa) offset which goes past the end of the section name string table
379 # NAME-GNU-NEXT: warning: '[[FILE]]': unable to get the name of SHT_PROGBITS section with index 5: a section [index 5] has an invalid sh_name (0xbbbb) offset which goes past the end of the section name string table
381 # NAME-GNU-NEXT: COMDAT group section [ 1] `<?>' [foo] contains 2 sections:
382 # NAME-GNU-NEXT: [Index] Name
383 # NAME-GNU-NEXT: [ 3] .text.foo
384 # NAME-GNU-NEXT: [ 4] .rela.text.foo
386 # NAME-GNU-NEXT: COMDAT group section [ 2] `.group1' [bar] contains 2 sections:
387 # NAME-GNU-NEXT: [Index] Name
388 # NAME-GNU-NEXT: [ 5] <?>
389 # NAME-GNU-NEXT: [ 6] .rela.text.bar
391 ## Check we report a warning then the section index of a section group member is invalid.
393 # RUN: yaml2obj %s -DMEMBER1=0xEE -DMEMBER2=0xFF -o %t.member.index.o
394 # RUN: llvm-readobj --section-groups %t.member.index.o 2>&1 | \
395 # RUN: FileCheck -DFILE=%t.member.index.o %s --check-prefix=MEMBER-LLVM --implicit-check-not=warning:
396 # RUN: llvm-readelf --section-groups %t.member.index.o 2>&1 | \
397 # RUN: FileCheck -DFILE=%t.member.index.o %s --check-prefix=MEMBER-GNU --implicit-check-not=warning:
399 # MEMBER-LLVM: Groups {
400 # MEMBER-LLVM-NEXT: warning: '[[FILE]]': unable to get the section with index 238 when dumping the SHT_GROUP section with index 1: invalid section index: 238
401 # MEMBER-LLVM-NEXT: warning: '[[FILE]]': unable to get the section with index 255 when dumping the SHT_GROUP section with index 2: invalid section index: 255
402 # MEMBER-LLVM-NEXT: Group {
403 # MEMBER-LLVM-NEXT: Name: .group (16)
404 # MEMBER-LLVM-NEXT: Index: 1
405 # MEMBER-LLVM-NEXT: Link: 7
406 # MEMBER-LLVM-NEXT: Info: 1
407 # MEMBER-LLVM-NEXT: Type: COMDAT (0x1)
408 # MEMBER-LLVM-NEXT: Signature: foo
409 # MEMBER-LLVM-NEXT: Section(s) in group [
410 # MEMBER-LLVM-NEXT: .text.foo (3)
411 # MEMBER-LLVM-NEXT: <?> (238)
412 # MEMBER-LLVM-NEXT: ]
413 # MEMBER-LLVM-NEXT: }
414 # MEMBER-LLVM-NEXT: Group {
415 # MEMBER-LLVM-NEXT: Name: .group1 (64)
416 # MEMBER-LLVM-NEXT: Index: 2
417 # MEMBER-LLVM-NEXT: Link: 7
418 # MEMBER-LLVM-NEXT: Info: 2
419 # MEMBER-LLVM-NEXT: Type: COMDAT (0x1)
420 # MEMBER-LLVM-NEXT: Signature: bar
421 # MEMBER-LLVM-NEXT: Section(s) in group [
422 # MEMBER-LLVM-NEXT: <?> (255)
423 # MEMBER-LLVM-NEXT: .rela.text.bar (6)
424 # MEMBER-LLVM-NEXT: ]
425 # MEMBER-LLVM-NEXT: }
426 # MEMBER-LLVM-NEXT: }
428 # MEMBER-GNU: warning: '[[FILE]]': unable to get the section with index 238 when dumping the SHT_GROUP section with index 1: invalid section index: 238
429 # MEMBER-GNU-NEXT: warning: '[[FILE]]': unable to get the section with index 255 when dumping the SHT_GROUP section with index 2: invalid section index: 255
431 # MEMBER-GNU-NEXT: COMDAT group section [ 1] `.group' [foo] contains 2 sections:
432 # MEMBER-GNU-NEXT: [Index] Name
433 # MEMBER-GNU-NEXT: [ 3] .text.foo
434 # MEMBER-GNU-NEXT: [ 238] <?>
436 # MEMBER-GNU-NEXT: COMDAT group section [ 2] `.group1' [bar] contains 2 sections:
437 # MEMBER-GNU-NEXT: [Index] Name
438 # MEMBER-GNU-NEXT: [ 255] <?>
439 # MEMBER-GNU-NEXT: [ 6] .rela.text.bar
441 ## Check warnings that are reported when the st_name field of the signature symbol goes past the end of the string table.
443 ## We set the content of the string table to '0061626300' ('\0abc\0') to fixup the size of the string table.
444 ## This makes it easier to test the boundary conditions.
445 # RUN: yaml2obj %s -DSTRTABCONTENT="0061626300" -DSYM1STNAME=4 -DSYM2STNAME=5 -o %t.signame.o
446 # RUN: llvm-readobj --section-groups %t.signame.o 2>&1 | \
447 # RUN: FileCheck -DFILE=%t.signame.o %s --check-prefixes=SIGNAME1-WARN,SIGNAME1-LLVM --implicit-check-not=warning:
448 # RUN: llvm-readelf --section-groups %t.signame.o 2>&1 | \
449 # RUN: FileCheck -DFILE=%t.signame.o %s --check-prefixes=SIGNAME1-WARN,SIGNAME1-GNU --implicit-check-not=warning:
451 # SIGNAME1-WARN: warning: '[[FILE]]': unable to get the name of the symbol with index 2: st_name (0x5) is past the end of the string table of size 0x5
453 # SIGNAME1-LLVM: Signature: {{$}}
454 # SIGNAME1-LLVM: Signature: <?>
456 # SIGNAME1-GNU: COMDAT group section [ 1] `.group' [] contains 2 sections:
457 # SIGNAME1-GNU: COMDAT group section [ 2] `.group1' [<?>] contains 2 sections:
459 ## Check we report a warning when the string table that contains the signature symbol name is not null-terminated.
461 # RUN: yaml2obj %s -DSTRTABCONTENT="0061626361" -DSYM1STNAME=4 -DSYM2STNAME=5 -o %t.signame2.o
462 # RUN: llvm-readobj --section-groups %t.signame2.o 2>&1 | \
463 # RUN: FileCheck -DFILE=%t.signame2.o %s --check-prefixes=SIGNAME2-WARN,SIGNAME2-LLVM --implicit-check-not=warning:
464 # RUN: llvm-readelf --section-groups %t.signame2.o 2>&1 | \
465 # RUN: FileCheck -DFILE=%t.signame2.o %s --check-prefixes=SIGNAME2-WARN,SIGNAME2-GNU --implicit-check-not=warning:
467 # SIGNAME2-WARN: warning: '[[FILE]]': unable to get the string table for SHT_SYMTAB section with index 7: SHT_STRTAB string table section [index 8] is non-null terminated
469 # SIGNAME2-LLVM: Signature: <?>
470 # SIGNAME2-LLVM: Signature: <?>
472 # SIGNAME2-GNU: COMDAT group section [ 1] `.group' [<?>] contains 2 sections:
473 # SIGNAME2-GNU: COMDAT group section [ 2] `.group1' [<?>] contains 2 sections: