1 ## Test how llvm-readobj/llvm-readelf tools dump versioning sections.
2 ## Check that SHT_GNU_versym dumper can see versions described in
3 ## SHT_GNU_verdef and SHT_GNU_verneed sections.
5 # RUN: yaml2obj %s --docnum=1 -o %t1
6 # RUN: llvm-readobj -V %t1 | FileCheck %s --check-prefix=LLVM
7 # RUN: llvm-readelf -V %t1 | FileCheck %s --check-prefix=GNU
13 OSABI: ELFOSABI_FREEBSD
19 AddressAlign: 0x0000000000000002
20 Entries: [ 0, 2, 3, 4, 5, 6]
21 - Name: .gnu.version_d
24 AddressAlign: 0x0000000000000004
49 - Name: .gnu.version_r
52 AddressAlign: 0x0000000000000004
97 # LLVM: VersionSymbols [
99 # LLVM-NEXT: Version: 0
102 # LLVM-NEXT: Symbol {
103 # LLVM-NEXT: Version: 2
104 # LLVM-NEXT: Name: sym1@VERSION1
106 # LLVM-NEXT: Symbol {
107 # LLVM-NEXT: Version: 3
108 # LLVM-NEXT: Name: sym2@VERSION2
110 # LLVM-NEXT: Symbol {
111 # LLVM-NEXT: Version: 4
112 # LLVM-NEXT: Name: sym3@v1
114 # LLVM-NEXT: Symbol {
115 # LLVM-NEXT: Version: 5
116 # LLVM-NEXT: Name: sym4@v2
118 # LLVM-NEXT: Symbol {
119 # LLVM-NEXT: Version: 6
120 # LLVM-NEXT: Name: sym5@v3
123 # LLVM-NEXT: VersionDefinitions [
124 # LLVM-NEXT: Definition {
125 # LLVM-NEXT: Version: 1
126 # LLVM-NEXT: Flags [ (0x0)
128 # LLVM-NEXT: Index: 0
130 # LLVM-NEXT: Name: VERSION1
131 # LLVM-NEXT: Predecessors: []
133 # LLVM-NEXT: Definition {
134 # LLVM-NEXT: Version: 1
135 # LLVM-NEXT: Flags [ (0x1)
136 # LLVM-NEXT: Base (0x1)
138 # LLVM-NEXT: Index: 0
140 # LLVM-NEXT: Name: VERSION1
141 # LLVM-NEXT: Predecessors: []
143 # LLVM-NEXT: Definition {
144 # LLVM-NEXT: Version: 1
145 # LLVM-NEXT: Flags [ (0x2)
146 # LLVM-NEXT: Weak (0x2)
148 # LLVM-NEXT: Index: 0
150 # LLVM-NEXT: Name: VERSION1
151 # LLVM-NEXT: Predecessors: []
153 # LLVM-NEXT: Definition {
154 # LLVM-NEXT: Version: 1
155 # LLVM-NEXT: Flags [ (0x4)
156 # LLVM-NEXT: Info (0x4)
158 # LLVM-NEXT: Index: 0
160 # LLVM-NEXT: Name: VERSION1
161 # LLVM-NEXT: Predecessors: []
163 # LLVM-NEXT: Definition {
164 # LLVM-NEXT: Version: 1
165 # LLVM-NEXT: Flags [ (0x7)
166 # LLVM-NEXT: Base (0x1)
167 # LLVM-NEXT: Info (0x4)
168 # LLVM-NEXT: Weak (0x2)
170 # LLVM-NEXT: Index: 2
171 # LLVM-NEXT: Hash: 175630257
172 # LLVM-NEXT: Name: VERSION1
173 # LLVM-NEXT: Predecessors: []
175 # LLVM-NEXT: Definition {
176 # LLVM-NEXT: Version: 1
177 # LLVM-NEXT: Flags [ (0x8)
179 # LLVM-NEXT: Index: 3
180 # LLVM-NEXT: Hash: 175630258
181 # LLVM-NEXT: Name: VERSION2
182 # LLVM-NEXT: Predecessors: [VERSION1, VERSION3]
185 # LLVM-NEXT: VersionRequirements [
186 # LLVM-NEXT: Dependency {
187 # LLVM-NEXT: Version: 1
188 # LLVM-NEXT: Count: 5
189 # LLVM-NEXT: FileName: verneed1.so.0
190 # LLVM-NEXT: Entries [
193 # LLVM-NEXT: Flags [ (0x1)
194 # LLVM-NEXT: Base (0x1)
196 # LLVM-NEXT: Index: 0
197 # LLVM-NEXT: Name: v1
201 # LLVM-NEXT: Flags [ (0x2)
202 # LLVM-NEXT: Weak (0x2)
204 # LLVM-NEXT: Index: 0
205 # LLVM-NEXT: Name: v1
209 # LLVM-NEXT: Flags [ (0x4)
210 # LLVM-NEXT: Info (0x4)
212 # LLVM-NEXT: Index: 0
213 # LLVM-NEXT: Name: v1
216 # LLVM-NEXT: Hash: 1938
217 # LLVM-NEXT: Flags [ (0x7)
218 # LLVM-NEXT: Base (0x1)
219 # LLVM-NEXT: Info (0x4)
220 # LLVM-NEXT: Weak (0x2)
222 # LLVM-NEXT: Index: 4
223 # LLVM-NEXT: Name: v1
226 # LLVM-NEXT: Hash: 1939
227 # LLVM-NEXT: Flags [ (0x8)
229 # LLVM-NEXT: Index: 5
230 # LLVM-NEXT: Name: v2
234 # LLVM-NEXT: Dependency {
235 # LLVM-NEXT: Version: 1
236 # LLVM-NEXT: Count: 1
237 # LLVM-NEXT: FileName: verneed2.so.0
238 # LLVM-NEXT: Entries [
240 # LLVM-NEXT: Hash: 1937
241 # LLVM-NEXT: Flags [ (0x0)
243 # LLVM-NEXT: Index: 6
244 # LLVM-NEXT: Name: v3
250 # GNU: Version symbols section '.gnu.version' contains 6 entries:
251 # GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 4 (.dynsym)
252 # GNU-NEXT: 000: 0 (*local*) 2 (VERSION1) 3 (VERSION2) 4 (v1)
253 # GNU-NEXT: 004: 5 (v2) 6 (v3)
255 # GNU-NEXT: Version definition section '.gnu.version_d' contains 6 entries:
256 # GNU-NEXT: Addr: 000000000000000c Offset: 0x00004c Link: 5 (.dynstr)
257 # GNU-NEXT: 0x0000: Rev: 1 Flags: none Index: 0 Cnt: 1 Name: VERSION1
258 # GNU-NEXT: 0x001c: Rev: 1 Flags: BASE Index: 0 Cnt: 1 Name: VERSION1
259 # GNU-NEXT: 0x0038: Rev: 1 Flags: WEAK Index: 0 Cnt: 1 Name: VERSION1
260 # GNU-NEXT: 0x0054: Rev: 1 Flags: INFO Index: 0 Cnt: 1 Name: VERSION1
261 # GNU-NEXT: 0x0070: Rev: 1 Flags: BASE | WEAK | INFO Index: 2 Cnt: 1 Name: VERSION1
262 # GNU-NEXT: 0x008c: Rev: 1 Flags: <unknown> Index: 3 Cnt: 3 Name: VERSION2
263 # GNU-NEXT: 0x00b0: Parent 1: VERSION1
264 # GNU-NEXT: 0x00b0: Parent 2: VERSION3
266 # GNU-NEXT: Version needs section '.gnu.version_r' contains 2 entries:
267 # GNU-NEXT: Addr: 00000000000000c4 Offset: 0x000104 Link: 5 (.dynstr)
268 # GNU-NEXT: 0x0000: Version: 1 File: verneed1.so.0 Cnt: 5
269 # GNU-NEXT: 0x0010: Name: v1 Flags: BASE Version: 0
270 # GNU-NEXT: 0x0020: Name: v1 Flags: WEAK Version: 0
271 # GNU-NEXT: 0x0030: Name: v1 Flags: INFO Version: 0
272 # GNU-NEXT: 0x0040: Name: v1 Flags: BASE | WEAK | INFO Version: 4
273 # GNU-NEXT: 0x0050: Name: v2 Flags: <unknown> Version: 5
274 # GNU-NEXT: 0x0060: Version: 1 File: verneed2.so.0 Cnt: 1
275 # GNU-NEXT: 0x0070: Name: v3 Flags: none Version: 6