blob: 0de4893b89ba3bcad5ed9651cab9b2c20248984b [file] [log] [blame]
George Rimar762abff62017-09-16 14:29:51 +00001# RUN: yaml2obj %s -o %t.o
2
3# RUN: llvm-readobj --elf-section-groups -elf-output-style=GNU \
4# RUN: %t.o >%tout.log 2>%terr.log
5# RUN: FileCheck %s -check-prefix=GNU-STDERR < %terr.log
6# GNU-STDERR: Error: section [ 3] in group section [ 4] already in group section [ 2]
7# RUN: FileCheck %s -check-prefix=GNU-STDOUT < %tout.log
8# GNU-STDOUT: COMDAT group section [ 2] `.group' [bar] contains 1 sections:
9# GNU-STDOUT-NEXT: [Index] Name
10# GNU-STDOUT-NEXT: [ 3] .foo
11# GNU-STDOUT: COMDAT group section [ 4] `.group1' [zed] contains 1 sections:
12# GNU-STDOUT-NEXT: [Index] Name
13
14# RUN: llvm-readobj --elf-section-groups \
15# RUN: %t.o >%t2out.log 2>%t2err.log %t.o
16# RUN: FileCheck %s -check-prefix=LLVM-STDERR < %t2err.log
17# LLVM-STDERR: Error: .foo (3) in a group .group1 (4) is already in a group .group (2)
18# RUN: FileCheck %s -check-prefix=LLVM-STDOUT < %t2out.log
19# LLVM-STDOUT: Groups {
20# LLVM-STDOUT-NEXT: Group {
21# LLVM-STDOUT-NEXT: Name: .group
22# LLVM-STDOUT-NEXT: Index: 2
23# LLVM-STDOUT-NEXT: Type: COMDAT
24# LLVM-STDOUT-NEXT: Signature: bar
25# LLVM-STDOUT-NEXT: Section(s) in group [
26# LLVM-STDOUT-NEXT: .foo (3)
27# LLVM-STDOUT-NEXT: ]
28# LLVM-STDOUT-NEXT: }
29# LLVM-STDOUT-NEXT: Group {
30# LLVM-STDOUT-NEXT: Name: .group1
31# LLVM-STDOUT-NEXT: Index: 4
32# LLVM-STDOUT-NEXT: Type: COMDAT
33# LLVM-STDOUT-NEXT: Signature: zed
34# LLVM-STDOUT-NEXT: Section(s) in group [
35# LLVM-STDOUT-NEXT: ]
36# LLVM-STDOUT-NEXT: }
37# LLVM-STDOUT-NEXT: }
38
39!ELF
40FileHeader:
41 Class: ELFCLASS64
42 Data: ELFDATA2LSB
43 Type: ET_REL
44 Machine: EM_X86_64
45Sections:
46 - Name: .text
47 Type: SHT_PROGBITS
48 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
49 AddressAlign: 0x0000000000000004
50 Content: ''
51 - Name: .group
52 Type: SHT_GROUP
53 Link: .symtab
54 AddressAlign: 0x0000000000000004
55 Info: bar
56 Members:
57 - SectionOrType: GRP_COMDAT
58 - SectionOrType: .foo
59 - Name: .foo
60 Type: SHT_PROGBITS
61 Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
62 AddressAlign: 0x0000000000000001
63 Content: ''
64 - Name: .group1
65 Type: SHT_GROUP
66 Link: .symtab
67 AddressAlign: 0x0000000000000004
68 Info: zed
69 Members:
70 - SectionOrType: GRP_COMDAT
71 - SectionOrType: .foo
72Symbols:
73 Local:
74 - Name: bar
75 Section: .group
76 - Name: zed
77 Section: .group1