1## Check how we dump regular ELF section flags.
2
3# RUN: yaml2obj %s -o %t.o
4# RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=LLVM %s
5# RUN: llvm-readelf -S %t.o | FileCheck --check-prefix=GNU %s
6
7# LLVM:      Name: allflags
8# LLVM-NEXT: Type: SHT_PROGBITS
9# LLVM-NEXT: Flags [ (0x80000FF7)
10# LLVM-NEXT:   SHF_ALLOC (0x2)
11# LLVM-NEXT:   SHF_COMPRESSED (0x800)
12# LLVM-NEXT:   SHF_EXCLUDE (0x80000000)
13# LLVM-NEXT:   SHF_EXECINSTR (0x4)
14# LLVM-NEXT:   SHF_GROUP (0x200)
15# LLVM-NEXT:   SHF_INFO_LINK (0x40)
16# LLVM-NEXT:   SHF_LINK_ORDER (0x80)
17# LLVM-NEXT:   SHF_MERGE (0x10)
18# LLVM-NEXT:   SHF_OS_NONCONFORMING (0x100)
19# LLVM-NEXT:   SHF_STRINGS (0x20)
20# LLVM-NEXT:   SHF_TLS (0x400)
21# LLVM-NEXT:   SHF_WRITE (0x1)
22# LLVM-NEXT: ]
23
24# LLVM:      Name: noflags
25# LLVM-NEXT: Type: SHT_PROGBITS
26# LLVM-NEXT: Flags [ (0x0)
27# LLVM-NEXT: ]
28
29# LLVM:      Name: write
30# LLVM-NEXT: Type: SHT_PROGBITS
31# LLVM-NEXT: Flags [ (0x1)
32# LLVM-NEXT:   SHF_WRITE (0x1)
33# LLVM-NEXT: ]
34
35# LLVM:      Name: alloc
36# LLVM-NEXT: Type: SHT_PROGBITS
37# LLVM-NEXT: Flags [ (0x2)
38# LLVM-NEXT:   SHF_ALLOC (0x2)
39# LLVM-NEXT: ]
40
41# LLVM:      Name: exec
42# LLVM-NEXT: Type: SHT_PROGBITS
43# LLVM-NEXT: Flags [ (0x4)
44# LLVM-NEXT:   SHF_EXECINSTR (0x4)
45# LLVM-NEXT: ]
46
47# LLVM:      Name: merge
48# LLVM-NEXT: Type: SHT_PROGBITS
49# LLVM-NEXT: Flags [ (0x10)
50# LLVM-NEXT:   SHF_MERGE (0x10)
51# LLVM-NEXT: ]
52
53# LLVM:      Name: strings
54# LLVM-NEXT: Type: SHT_PROGBITS
55# LLVM-NEXT: Flags [ (0x20)
56# LLVM-NEXT:   SHF_STRINGS (0x20)
57# LLVM-NEXT: ]
58
59# LLVM:      Name: infolink
60# LLVM-NEXT: Type: SHT_PROGBITS
61# LLVM-NEXT: Flags [ (0x40)
62# LLVM-NEXT:   SHF_INFO_LINK (0x40)
63# LLVM-NEXT: ]
64
65# LLVM:      Name: linkorder
66# LLVM-NEXT: Type: SHT_PROGBITS
67# LLVM-NEXT: Flags [ (0x80)
68# LLVM-NEXT:   SHF_LINK_ORDER (0x80)
69# LLVM-NEXT: ]
70
71# LLVM:      Name: nonconforming
72# LLVM-NEXT: Type: SHT_PROGBITS
73# LLVM-NEXT: Flags [ (0x100)
74# LLVM-NEXT:   SHF_OS_NONCONFORMING (0x100)
75# LLVM-NEXT: ]
76
77# LLVM:      Name: group
78# LLVM-NEXT: Type: SHT_PROGBITS
79# LLVM-NEXT: Flags [ (0x200)
80# LLVM-NEXT:   SHF_GROUP (0x200)
81# LLVM-NEXT: ]
82
83# LLVM:      Name: tls
84# LLVM-NEXT: Type: SHT_PROGBITS
85# LLVM-NEXT: Flags [ (0x400)
86# LLVM-NEXT:   SHF_TLS (0x400)
87# LLVM-NEXT: ]
88
89# LLVM:      Name: compressed
90# LLVM-NEXT: Type: SHT_PROGBITS
91# LLVM-NEXT: Flags [ (0x800)
92# LLVM-NEXT:   SHF_COMPRESSED (0x800)
93# LLVM-NEXT: ]
94
95# LLVM:      Name: exclude
96# LLVM-NEXT: Type: SHT_PROGBITS
97# LLVM-NEXT: Flags [ (0x80000000)
98# LLVM-NEXT:   SHF_EXCLUDE (0x80000000)
99# LLVM-NEXT: ]
100
101# LLVM:      Name: unknown
102# LLVM-NEXT: Type: SHT_PROGBITS
103# LLVM-NEXT: Flags [ (0xF0000)
104# LLVM-NEXT: ]
105
106# GNU: [Nr] Name          Type     Address          Off    Size   ES Flg          Lk Inf Al
107# GNU: [ 1] allflags      PROGBITS 0000000000000000 000040 000000 00 WAXMSILOGTCE 0   0  0
108# GNU: [ 2] noflags       PROGBITS 0000000000000000 000040 000000 00              0   0  0
109# GNU: [ 3] write         PROGBITS 0000000000000000 000040 000000 00 W            0   0  0
110# GNU: [ 4] alloc         PROGBITS 0000000000000000 000040 000000 00 A            0   0  0
111# GNU: [ 5] exec          PROGBITS 0000000000000000 000040 000000 00 X            0   0  0
112# GNU: [ 6] merge         PROGBITS 0000000000000000 000040 000000 00 M            0   0  0
113# GNU: [ 7] strings       PROGBITS 0000000000000000 000040 000000 00 S            0   0  0
114# GNU: [ 8] infolink      PROGBITS 0000000000000000 000040 000000 00 I            0   0  0
115# GNU: [ 9] linkorder     PROGBITS 0000000000000000 000040 000000 00 L            0   0  0
116# GNU: [10] nonconforming PROGBITS 0000000000000000 000040 000000 00 O            0   0  0
117# GNU: [11] group         PROGBITS 0000000000000000 000040 000000 00 G            0   0  0
118# GNU: [12] tls           PROGBITS 0000000000000000 000040 000000 00 T            0   0  0
119# GNU: [13] compressed    PROGBITS 0000000000000000 000040 000000 00 C            0   0  0
120# GNU: [14] exclude       PROGBITS 0000000000000000 000040 000000 00 E            0   0  0
121# GNU: [15] unknown       PROGBITS 0000000000000000 000040 000000 00 x            0   0  0
122
123--- !ELF
124FileHeader:
125  Class: ELFCLASS64
126  Data:  ELFDATA2LSB
127  Type:  ET_REL
128  Flags: []
129Sections:
130  - Name:  allflags
131    Type:  SHT_PROGBITS
132    Flags: [ SHF_WRITE, SHF_ALLOC, SHF_EXECINSTR, SHF_MERGE,
133            SHF_STRINGS, SHF_INFO_LINK, SHF_LINK_ORDER, SHF_OS_NONCONFORMING,
134            SHF_GROUP, SHF_TLS, SHF_COMPRESSED, SHF_EXCLUDE ]
135  - Name:  noflags
136    Type:  SHT_PROGBITS
137    Flags: [ ]
138  - Name:  write
139    Type:  SHT_PROGBITS
140    Flags: [ SHF_WRITE ]
141  - Name:  alloc
142    Type:  SHT_PROGBITS
143    Flags: [ SHF_ALLOC ]
144  - Name:  exec
145    Type:  SHT_PROGBITS
146    Flags: [ SHF_EXECINSTR ]
147  - Name:  merge
148    Type:  SHT_PROGBITS
149    Flags: [ SHF_MERGE ]
150  - Name:  strings
151    Type:  SHT_PROGBITS
152    Flags: [ SHF_STRINGS ]
153  - Name:  infolink
154    Type:  SHT_PROGBITS
155    Flags: [ SHF_INFO_LINK ]
156  - Name:  linkorder
157    Type:  SHT_PROGBITS
158    Flags: [ SHF_LINK_ORDER ]
159  - Name:  nonconforming
160    Type:  SHT_PROGBITS
161    Flags: [ SHF_OS_NONCONFORMING ]
162  - Name:  group
163    Type:  SHT_PROGBITS
164    Flags: [ SHF_GROUP ]
165  - Name:  tls
166    Type:  SHT_PROGBITS
167    Flags: [ SHF_TLS ]
168  - Name:  compressed
169    Type:  SHT_PROGBITS
170    Flags: [ SHF_COMPRESSED ]
171  - Name:  exclude
172    Type:  SHT_PROGBITS
173    Flags: [ SHF_EXCLUDE ]
174  - Name:  unknown
175    Type:  SHT_PROGBITS
176    ShFlags: 0x000f0000
177