[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / tools / llvm-objdump / ELF / dynamic-section.test
blob5205c5a3876d5fb9230e15debee3b66efb6b25d4
1 # RUN: yaml2obj --docnum=1 %s -o %t1
2 # RUN: llvm-objdump -p %t1 | FileCheck %s --strict-whitespace --match-full-lines --check-prefix=ELF64
4 #      ELF64:Dynamic Section:
5 # ELF64-NEXT:  NEEDED               D
6 # ELF64-NEXT:  PLTRELSZ             0x0000000000000010
7 # ELF64-NEXT:  PLTGOT               0x0000000000001000
8 # ELF64-NEXT:  HASH                 0x0000000000001000
9 # ELF64-NEXT:  STRTAB               0x0000000000001000
10 # ELF64-NEXT:  SYMTAB               0x0000000000001000
11 # ELF64-NEXT:  RELA                 0x0000000000001000
12 # ELF64-NEXT:  RELASZ               0x0000000000000010
13 # ELF64-NEXT:  RELAENT              0x0000000000000789
14 # ELF64-NEXT:  STRSZ                0x0000000000000010
15 # ELF64-NEXT:  SYMENT               0x0000000000000987
16 # ELF64-NEXT:  INIT                 0x0000000000001000
17 # ELF64-NEXT:  FINI                 0x0000000000001000
18 # ELF64-NEXT:  SONAME               U
19 # ELF64-NEXT:  RPATH                f
20 # ELF64-NEXT:  SYMBOLIC             0x1234567890abcdef
21 # ELF64-NEXT:  REL                  0x0000000000001000
22 # ELF64-NEXT:  RELSZ                0x0000000000000010
23 # ELF64-NEXT:  RELENT               0x0000000000000123
24 # ELF64-NEXT:  PLTREL               0x0000000000000007
25 # ELF64-NEXT:  DEBUG                0xfedcba0987654321
26 # ELF64-NEXT:  TEXTREL              0x1122334455667788
27 # ELF64-NEXT:  JMPREL               0x0000000000001000
28 # ELF64-NEXT:  BIND_NOW             0x8877665544332211
29 # ELF64-NEXT:  INIT_ARRAY           0x0000000000001000
30 # ELF64-NEXT:  FINI_ARRAY           0x0000000000001000
31 # ELF64-NEXT:  INIT_ARRAYSZ         0x0000000000000010
32 # ELF64-NEXT:  FINI_ARRAYSZ         0x0000000000000010
33 # ELF64-NEXT:  RUNPATH              w
34 # ELF64-NEXT:  FLAGS                0xaabbccddeeff9900
35 # ELF64-NEXT:  PREINIT_ARRAY        0x0000000000001000
36 # ELF64-NEXT:  PREINIT_ARRAYSZ      0x0000000000000010
37 # ELF64-NEXT:  SYMTAB_SHNDX         0x0000000000001000
38 # ELF64-NEXT:  RELRSZ               0x0000000000000010
39 # ELF64-NEXT:  RELR                 0x0000000000001000
40 # ELF64-NEXT:  RELRENT              0x0000000000004321
41 # ELF64-NEXT:  ANDROID_REL          0x0000000000001000
42 # ELF64-NEXT:  ANDROID_RELSZ        0x0000000000000010
43 # ELF64-NEXT:  ANDROID_RELA         0x0000000000001000
44 # ELF64-NEXT:  ANDROID_RELASZ       0x0000000000000010
45 # ELF64-NEXT:  ANDROID_RELR         0x0000000000001000
46 # ELF64-NEXT:  ANDROID_RELRSZ       0x0000000000000010
47 # ELF64-NEXT:  ANDROID_RELRENT      0x0000000000001234
48 # ELF64-NEXT:  GNU_HASH             0x0000000000001000
49 # ELF64-NEXT:  TLSDESC_PLT          0x0000000000001000
50 # ELF64-NEXT:  TLSDESC_GOT          0x0000000000001000
51 # ELF64-NEXT:  RELACOUNT            0x0000000000000000
52 # ELF64-NEXT:  RELCOUNT             0x0000000000000000
53 # ELF64-NEXT:  FLAGS_1              0x0000000087654321
54 # ELF64-NEXT:  VERSYM               0x0000000000001000
55 # ELF64-NEXT:  VERDEF               0x0000000000001000
56 # ELF64-NEXT:  VERDEFNUM            0x0000000000000000
57 # ELF64-NEXT:  VERNEED              0x0000000000001000
58 # ELF64-NEXT:  VERNEEDNUM           0x0000000000000000
59 # ELF64-NEXT:  AUXILIARY            D
60 # ELF64-NEXT:  FILTER               U
61 # ELF64-NEXT:  <unknown:>0x12345678 0x8765432187654321
62 # ELF64-NEXT:  <unknown:>0x6abcdef0 0x9988776655443322
63 # ELF64-NEXT:  <unknown:>0x76543210 0x5555666677778888
64 # ELF64-NOT:{{.}}
66 --- !ELF
67 FileHeader:
68   Class:   ELFCLASS64
69   Data:    ELFDATA2LSB
70   Type:    ET_EXEC
71   Machine: EM_X86_64
72 Sections:
73   - Name:    .dynstr
74     Type:    SHT_STRTAB
75     Address: 0x1000
76     Size:    0x10
77     Content: "004400550066007700"
78   - Name:    .dynamic
79     Type:    SHT_DYNAMIC
80     Address: 0x1010
81     Link:    1
82     Entries:
83      - Tag:   DT_NEEDED
84        Value: 0x1
85      - Tag:   DT_PLTRELSZ
86        Value: 0x10
87      - Tag:   DT_PLTGOT
88        Value: 0x1000
89      - Tag:   DT_HASH
90        Value: 0x1000
91      - Tag:   DT_STRTAB
92        Value: 0x1000
93      - Tag:   DT_SYMTAB
94        Value: 0x1000
95      - Tag:   DT_RELA
96        Value: 0x1000
97      - Tag:   DT_RELASZ
98        Value: 0x10
99      - Tag:   DT_RELAENT
100        Value: 0x789
101      - Tag:   DT_STRSZ
102        Value: 0x10
103      - Tag:   DT_SYMENT
104        Value: 0x987
105      - Tag:   DT_INIT
106        Value: 0x1000
107      - Tag:   DT_FINI
108        Value: 0x1000
109      - Tag:   DT_SONAME
110        Value: 0x3
111      - Tag:   DT_RPATH
112        Value: 0x5
113      - Tag:   DT_SYMBOLIC
114        Value: 0x1234567890abcdef
115      - Tag:   DT_REL
116        Value: 0x1000
117      - Tag:   DT_RELSZ
118        Value: 0x10
119      - Tag:   DT_RELENT
120        Value: 0x123
121      - Tag:   DT_PLTREL
122        Value: 0x7
123      - Tag:   DT_DEBUG
124        Value: 0xfedcba0987654321
125      - Tag:   DT_TEXTREL
126        Value: 0x1122334455667788
127      - Tag:   DT_JMPREL
128        Value: 0x1000
129      - Tag:   DT_BIND_NOW
130        Value: 0x8877665544332211
131      - Tag:   DT_INIT_ARRAY
132        Value: 0x1000
133      - Tag:   DT_FINI_ARRAY
134        Value: 0x1000
135      - Tag:   DT_INIT_ARRAYSZ
136        Value: 0x10
137      - Tag:   DT_FINI_ARRAYSZ
138        Value: 0x10
139      - Tag:   DT_RUNPATH
140        Value: 0x7
141      - Tag:   DT_FLAGS
142        Value: 0xaabbccddeeff9900
143      - Tag:   DT_PREINIT_ARRAY
144        Value: 0x1000
145      - Tag:   DT_PREINIT_ARRAYSZ
146        Value: 0x10
147      - Tag:   DT_SYMTAB_SHNDX
148        Value: 0x1000
149      - Tag:   DT_RELRSZ
150        Value: 0x10
151      - Tag:   DT_RELR
152        Value: 0x1000
153      - Tag:   DT_RELRENT
154        Value: 0x4321
155      - Tag:   DT_ANDROID_REL
156        Value: 0x1000
157      - Tag:   DT_ANDROID_RELSZ
158        Value: 0x10
159      - Tag:   DT_ANDROID_RELA
160        Value: 0x1000
161      - Tag:   DT_ANDROID_RELASZ
162        Value: 0x10
163      - Tag:   DT_ANDROID_RELR
164        Value: 0x1000
165      - Tag:   DT_ANDROID_RELRSZ
166        Value: 0x10
167      - Tag:   DT_ANDROID_RELRENT
168        Value: 0x1234
169      - Tag:   DT_GNU_HASH
170        Value: 0x1000
171      - Tag:   DT_TLSDESC_PLT
172        Value: 0x1000
173      - Tag:   DT_TLSDESC_GOT
174        Value: 0x1000
175      - Tag:   DT_RELACOUNT
176        Value: 0x0
177      - Tag:   DT_RELCOUNT
178        Value: 0x0
179      - Tag:   DT_FLAGS_1
180        Value: 0x87654321
181      - Tag:   DT_VERSYM
182        Value: 0x1000
183      - Tag:   DT_VERDEF
184        Value: 0x1000
185      - Tag:   DT_VERDEFNUM
186        Value: 0x0
187      - Tag:   DT_VERNEED
188        Value: 0x1000
189      - Tag:   DT_VERNEEDNUM
190        Value: 0x0
191      - Tag:   DT_AUXILIARY
192        Value: 0x1
193      - Tag:   DT_FILTER
194        Value: 0x3
195 ## Show behaviour for unknown values in special and unmarked ranges.
196 ## An arbitrary unknown value outside of the special ranges.
197      - Tag:   0x12345678
198        Value: 0x8765432187654321
199 ## An OS specific tag.
200      - Tag:   0x6abcdef0
201        Value: 0x9988776655443322
202 ## A processor specific tags.
203      - Tag:   0x76543210
204        Value: 0x5555666677778888
205      - Tag:   DT_NULL
206        Value: 0x0
207 ProgramHeaders:
208   - Type:     PT_LOAD
209     VAddr:    0x1000
210     FirstSec: .dynstr
211     LastSec:  .dynamic
212   - Type:     PT_DYNAMIC
213     VAddr:    0x1010
214     FirstSec: .dynamic
215     LastSec:  .dynamic
217 # RUN: yaml2obj --docnum=2 %s -o %t2
218 # RUN: llvm-objdump -p %t2 | FileCheck %s --strict-whitespace --match-full-lines --check-prefix=ELF32
220 #      ELF32:Dynamic Section:
221 # ELF32-NEXT:  NEEDED               D
222 # ELF32-NEXT:  PLTRELSZ             0x00000010
223 # ELF32-NEXT:  PLTGOT               0x00001000
224 # ELF32-NEXT:  HASH                 0x00001000
225 # ELF32-NEXT:  STRTAB               0x00001000
226 # ELF32-NEXT:  SYMTAB               0x00001000
227 # ELF32-NEXT:  RELA                 0x00001000
228 # ELF32-NEXT:  RELASZ               0x00000010
229 # ELF32-NEXT:  RELAENT              0x00000789
230 # ELF32-NEXT:  STRSZ                0x00000010
231 # ELF32-NEXT:  SYMENT               0x00000987
232 # ELF32-NEXT:  INIT                 0x00001000
233 # ELF32-NEXT:  FINI                 0x00001000
234 # ELF32-NEXT:  SONAME               U
235 # ELF32-NEXT:  RPATH                f
236 # ELF32-NEXT:  SYMBOLIC             0x12345678
237 # ELF32-NEXT:  REL                  0x00001000
238 # ELF32-NEXT:  RELSZ                0x00000010
239 # ELF32-NEXT:  RELENT               0x00000123
240 # ELF32-NEXT:  PLTREL               0x00000007
241 # ELF32-NEXT:  DEBUG                0xfedcba09
242 # ELF32-NEXT:  TEXTREL              0x11223344
243 # ELF32-NEXT:  JMPREL               0x00001000
244 # ELF32-NEXT:  BIND_NOW             0x88776655
245 # ELF32-NEXT:  INIT_ARRAY           0x00001000
246 # ELF32-NEXT:  FINI_ARRAY           0x00001000
247 # ELF32-NEXT:  INIT_ARRAYSZ         0x00000010
248 # ELF32-NEXT:  FINI_ARRAYSZ         0x00000010
249 # ELF32-NEXT:  RUNPATH              w
250 # ELF32-NEXT:  FLAGS                0xaabbccdd
251 # ELF32-NEXT:  PREINIT_ARRAY        0x00001000
252 # ELF32-NEXT:  PREINIT_ARRAYSZ      0x00000010
253 # ELF32-NEXT:  SYMTAB_SHNDX         0x00001000
254 # ELF32-NEXT:  RELRSZ               0x00000010
255 # ELF32-NEXT:  RELR                 0x00001000
256 # ELF32-NEXT:  RELRENT              0x00004321
257 # ELF32-NEXT:  ANDROID_REL          0x00001000
258 # ELF32-NEXT:  ANDROID_RELSZ        0x00000010
259 # ELF32-NEXT:  ANDROID_RELA         0x00001000
260 # ELF32-NEXT:  ANDROID_RELASZ       0x00000010
261 # ELF32-NEXT:  ANDROID_RELR         0x00001000
262 # ELF32-NEXT:  ANDROID_RELRSZ       0x00000010
263 # ELF32-NEXT:  ANDROID_RELRENT      0x00001234
264 # ELF32-NEXT:  GNU_HASH             0x00001000
265 # ELF32-NEXT:  TLSDESC_PLT          0x00001000
266 # ELF32-NEXT:  TLSDESC_GOT          0x00001000
267 # ELF32-NEXT:  RELACOUNT            0x00000000
268 # ELF32-NEXT:  RELCOUNT             0x00000000
269 # ELF32-NEXT:  FLAGS_1              0x87654321
270 # ELF32-NEXT:  VERSYM               0x00001000
271 # ELF32-NEXT:  VERDEF               0x00001000
272 # ELF32-NEXT:  VERDEFNUM            0x00000000
273 # ELF32-NEXT:  VERNEED              0x00001000
274 # ELF32-NEXT:  VERNEEDNUM           0x00000000
275 # ELF32-NEXT:  AUXILIARY            D
276 # ELF32-NEXT:  FILTER               U
277 # ELF32-NEXT:  <unknown:>0x12345678 0x87654321
278 # ELF32-NEXT:  <unknown:>0x6abcdef0 0x99887766
279 # ELF32-NEXT:  <unknown:>0x76543210 0x55556666
281 --- !ELF
282 FileHeader:
283   Class:   ELFCLASS32
284   Data:    ELFDATA2LSB
285   Type:    ET_EXEC
286   Machine: EM_386
287 Sections:
288   - Name:    .dynstr
289     Type:    SHT_STRTAB
290     Address: 0x1000
291     Size:    0x10
292     Content: "004400550066007700"
293   - Name:    .dynamic
294     Type:    SHT_DYNAMIC
295     Address: 0x1010
296     Link:    1
297     Entries:
298      - Tag:   DT_NEEDED
299        Value: 0x1
300      - Tag:   DT_PLTRELSZ
301        Value: 0x10
302      - Tag:   DT_PLTGOT
303        Value: 0x1000
304      - Tag:   DT_HASH
305        Value: 0x1000
306      - Tag:   DT_STRTAB
307        Value: 0x1000
308      - Tag:   DT_SYMTAB
309        Value: 0x1000
310      - Tag:   DT_RELA
311        Value: 0x1000
312      - Tag:   DT_RELASZ
313        Value: 0x10
314      - Tag:   DT_RELAENT
315        Value: 0x789
316      - Tag:   DT_STRSZ
317        Value: 0x10
318      - Tag:   DT_SYMENT
319        Value: 0x987
320      - Tag:   DT_INIT
321        Value: 0x1000
322      - Tag:   DT_FINI
323        Value: 0x1000
324      - Tag:   DT_SONAME
325        Value: 0x3
326      - Tag:   DT_RPATH
327        Value: 0x5
328      - Tag:   DT_SYMBOLIC
329        Value: 0x12345678
330      - Tag:   DT_REL
331        Value: 0x1000
332      - Tag:   DT_RELSZ
333        Value: 0x10
334      - Tag:   DT_RELENT
335        Value: 0x123
336      - Tag:   DT_PLTREL
337        Value: 0x7
338      - Tag:   DT_DEBUG
339        Value: 0xfedcba09
340      - Tag:   DT_TEXTREL
341        Value: 0x11223344
342      - Tag:   DT_JMPREL
343        Value: 0x1000
344      - Tag:   DT_BIND_NOW
345        Value: 0x88776655
346      - Tag:   DT_INIT_ARRAY
347        Value: 0x1000
348      - Tag:   DT_FINI_ARRAY
349        Value: 0x1000
350      - Tag:   DT_INIT_ARRAYSZ
351        Value: 0x10
352      - Tag:   DT_FINI_ARRAYSZ
353        Value: 0x10
354      - Tag:   DT_RUNPATH
355        Value: 0x7
356      - Tag:   DT_FLAGS
357        Value: 0xaabbccdd
358      - Tag:   DT_PREINIT_ARRAY
359        Value: 0x1000
360      - Tag:   DT_PREINIT_ARRAYSZ
361        Value: 0x10
362      - Tag:   DT_SYMTAB_SHNDX
363        Value: 0x1000
364      - Tag:   DT_RELRSZ
365        Value: 0x10
366      - Tag:   DT_RELR
367        Value: 0x1000
368      - Tag:   DT_RELRENT
369        Value: 0x4321
370      - Tag:   DT_ANDROID_REL
371        Value: 0x1000
372      - Tag:   DT_ANDROID_RELSZ
373        Value: 0x10
374      - Tag:   DT_ANDROID_RELA
375        Value: 0x1000
376      - Tag:   DT_ANDROID_RELASZ
377        Value: 0x10
378      - Tag:   DT_ANDROID_RELR
379        Value: 0x1000
380      - Tag:   DT_ANDROID_RELRSZ
381        Value: 0x10
382      - Tag:   DT_ANDROID_RELRENT
383        Value: 0x1234
384      - Tag:   DT_GNU_HASH
385        Value: 0x1000
386      - Tag:   DT_TLSDESC_PLT
387        Value: 0x1000
388      - Tag:   DT_TLSDESC_GOT
389        Value: 0x1000
390      - Tag:   DT_RELACOUNT
391        Value: 0x0
392      - Tag:   DT_RELCOUNT
393        Value: 0x0
394      - Tag:   DT_FLAGS_1
395        Value: 0x87654321
396      - Tag:   DT_VERSYM
397        Value: 0x1000
398      - Tag:   DT_VERDEF
399        Value: 0x1000
400      - Tag:   DT_VERDEFNUM
401        Value: 0x0
402      - Tag:   DT_VERNEED
403        Value: 0x1000
404      - Tag:   DT_VERNEEDNUM
405        Value: 0x0
406      - Tag:   DT_AUXILIARY
407        Value: 0x1
408      - Tag:   DT_FILTER
409        Value: 0x3
410 ## Show behaviour for unknown values in special and unmarked ranges.
411 ## An arbitrary unknown value outside of the special ranges.
412      - Tag:   0x12345678
413        Value: 0x87654321
414 ## An OS specific tag.
415      - Tag:   0x6abcdef0
416        Value: 0x99887766
417 ## A processor specific tags.
418      - Tag:   0x76543210
419        Value: 0x55556666
420      - Tag:   DT_NULL
421        Value: 0x0
422 ProgramHeaders:
423   - Type:     PT_LOAD
424     VAddr:    0x1000
425     FirstSec: .dynstr
426     LastSec:  .dynamic
427   - Type:     PT_DYNAMIC
428     VAddr:    0x1010
429     FirstSec: .dynamic
430     LastSec:  .dynamic
432 ## When printing the value column we want to have the minimal possible indentation.
433 ## Use an arbitrary dynamic tag to demonstrate that.
435 # RUN: yaml2obj --docnum=3 %s -o %t3
436 # RUN: llvm-objdump -p %t3 | FileCheck %s --strict-whitespace --check-prefix=INDENT
438 # RUN: yaml2obj --docnum=4 %s -o %t4
439 # RUN: llvm-objdump -p %t4 | FileCheck %s --strict-whitespace --check-prefix=INDENT
441 # INDENT: {{^}}Dynamic Section:
442 # INDENT: {{^}}  NEEDED 0x
444 --- !ELF
445 FileHeader:
446   Class:   ELFCLASS64
447   Data:    ELFDATA2LSB
448   Type:    ET_EXEC
449   Machine: EM_X86_64
450 Sections:
451   - Name: .dynamic
452     Type: SHT_DYNAMIC
453     Entries:
454      - Tag:   DT_NEEDED
455        Value: 0x1
456      - Tag:   DT_NULL
457        Value: 0x0
459 --- !ELF
460 FileHeader:
461   Class:   ELFCLASS32
462   Data:    ELFDATA2LSB
463   Type:    ET_EXEC
464   Machine: EM_386
465 Sections:
466   - Name: .dynamic
467     Type: SHT_DYNAMIC
468     Entries:
469      - Tag:   DT_NEEDED
470        Value: 0x1
471      - Tag:   DT_NULL
472        Value: 0x0