Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
[llvm-complete.git] / test / tools / yaml2obj / versym-section.yaml
blobfa28ae569b6846cf07aa40127b86851f4abb6d10
1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-readobj -V %t | FileCheck %s
4 ## Check we are able to produce a valid SHT_GNU_versym
5 ## section from its description.
7 # CHECK:      Version symbols {
8 # CHECK-NEXT:   Section Name: .gnu.version
9 # CHECK-NEXT:   Address: 0x200210
10 # CHECK-NEXT:   Offset: 0x240
11 # CHECK-NEXT:   Link: 6
12 # CHECK-NEXT:   Symbols [
13 # CHECK-NEXT:     Symbol {
14 # CHECK-NEXT:       Version: 0
15 # CHECK-NEXT:       Name:
16 # CHECK-NEXT:     }
17 # CHECK-NEXT:     Symbol {
18 # CHECK-NEXT:       Version: 3
19 # CHECK-NEXT:       Name: f1@v1
20 # CHECK-NEXT:     }
21 # CHECK-NEXT:     Symbol {
22 # CHECK-NEXT:       Version: 4
23 # CHECK-NEXT:       Name: f2@v2
24 # CHECK-NEXT:     }
25 # CHECK-NEXT:   ]
26 # CHECK-NEXT: }
27 # CHECK-NEXT: SHT_GNU_verdef {
28 # CHECK-NEXT: }
29 # CHECK-NEXT: SHT_GNU_verneed {
30 # CHECK-NEXT:   Dependency {
31 # CHECK-NEXT:     Version: 1
32 # CHECK-NEXT:     Count: 2
33 # CHECK-NEXT:     FileName: dso.so.0
34 # CHECK-NEXT:     Entries [
35 # CHECK-NEXT:       Entry {
36 # CHECK-NEXT:         Hash: 1937
37 # CHECK-NEXT:         Flags: 0x0
38 # CHECK-NEXT:         Index: 3
39 # CHECK-NEXT:         Name: v1
40 # CHECK-NEXT:       }
41 # CHECK-NEXT:       Entry {
42 # CHECK-NEXT:         Hash: 1938
43 # CHECK-NEXT:         Flags: 0x0
44 # CHECK-NEXT:         Index: 4
45 # CHECK-NEXT:         Name: v2
46 # CHECK-NEXT:       }
47 # CHECK-NEXT:     ]
48 # CHECK-NEXT:   }
49 # CHECK-NEXT: }
51 --- !ELF
52 FileHeader:
53   Class:           ELFCLASS64
54   Data:            ELFDATA2LSB
55   Type:            ET_EXEC
56   Machine:         EM_X86_64
57   Entry:           0x0000000000201000
58 Sections:
59   - Name:            .gnu.version
60     Type:            SHT_GNU_versym
61     Flags:           [ SHF_ALLOC ]
62     Address:         0x0000000000200210
63     Link:            .dynsym
64     AddressAlign:    0x0000000000000002
65     EntSize:         0x0000000000000002
66     Entries:         [ 0, 3, 4 ]
67   - Name:            .gnu.version_r
68     Type:            SHT_GNU_verneed
69     Flags:           [ SHF_ALLOC ]
70     Address:         0x0000000000200250
71     Link:            .dynstr
72     AddressAlign:    0x0000000000000004
73     Info:            0x0000000000000001
74     Dependencies:
75       - Version:         1
76         File:            dso.so.0
77         Entries:         
78           - Name:            v1
79             Hash:            1937
80             Flags:           0
81             Other:           3
82           - Name:            v2
83             Hash:            1938
84             Flags:           0
85             Other:           4
86 DynamicSymbols:
87   - Name:    f1
88     Binding: STB_GLOBAL
89   - Name:    f2
90     Binding: STB_GLOBAL
91 ...