2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/verneed1.s -o %t1.o
3 # RUN: echo "v1 {}; v2 {}; v3 { global: f1; local: *; };" > %t.script
4 # RUN: ld.lld -shared %t1.o --version-script %t.script --undefined-version -o %t1.so -soname verneed1.so.0
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/verneed2.s -o %t2.o
6 # RUN: ld.lld -shared %t2.o --version-script %t.script --undefined-version -o %t2.so -soname verneed2.so.0
8 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
9 # RUN: ld.lld --hash-style=sysv %t.o %t1.so %t2.so -o %t
10 # RUN: llvm-readobj -S -d --section-data --dyn-syms -V %t | FileCheck %s
14 # CHECK-NEXT: Name: .dynsym
15 # CHECK-NEXT: Type: SHT_DYNSYM (0xB)
16 # CHECK-NEXT: Flags [ (0x2)
17 # CHECK-NEXT: SHF_ALLOC (0x2)
19 # CHECK-NEXT: Address: 0x200200
20 # CHECK-NEXT: Offset: 0x200
21 # CHECK-NEXT: Size: 96
22 # CHECK-NEXT: Link: [[DYNSTR:.*]]
24 # CHECK-NEXT: AddressAlignment: 8
25 # CHECK-NEXT: EntrySize: 24
28 # CHECK-NEXT: Index: 2
29 # CHECK-NEXT: Name: .gnu.version
30 # CHECK-NEXT: Type: SHT_GNU_versym (0x6FFFFFFF)
31 # CHECK-NEXT: Flags [ (0x2)
32 # CHECK-NEXT: SHF_ALLOC (0x2)
34 # CHECK-NEXT: Address: [[VERSYM:.*]]
35 # CHECK-NEXT: Offset: [[VERSYM_OFFSET:.*]]
39 # CHECK-NEXT: AddressAlignment: 2
40 # CHECK-NEXT: EntrySize: 2
43 # CHECK-NEXT: Index: 3
44 # CHECK-NEXT: Name: .gnu.version_r
45 # CHECK-NEXT: Type: SHT_GNU_verneed (0x6FFFFFFE)
46 # CHECK-NEXT: Flags [ (0x2)
47 # CHECK-NEXT: SHF_ALLOC (0x2)
49 # CHECK-NEXT: Address: [[VERNEED:.*]]
50 # CHECK-NEXT: Offset: 0x268
51 # CHECK-NEXT: Size: 80
54 # CHECK-NEXT: AddressAlignment: 4
55 # CHECK-NEXT: EntrySize: 0
57 # CHECK: Index: [[DYNSTR]]
58 # CHECK-NEXT: Name: .dynstr
59 # CHECK-NEXT: Type: SHT_STRTAB (0x3)
60 # CHECK-NEXT: Flags [ (0x2)
61 # CHECK-NEXT: SHF_ALLOC (0x2)
63 # CHECK-NEXT: Address: 0x2002E0
64 # CHECK-NEXT: Offset: 0x2E0
65 # CHECK-NEXT: Size: 47
68 # CHECK-NEXT: AddressAlignment: 1
69 # CHECK-NEXT: EntrySize: 0
70 # CHECK-NEXT: SectionData (
71 # CHECK-NEXT: 0000: 00663100 66320067 31007665 726E6565 |.f1.f2.g1.vernee|
72 # CHECK-NEXT: 0010: 64312E73 6F2E3000 76320076 33007665 |d1.so.0.v2.v3.ve|
73 # CHECK-NEXT: 0020: 726E6565 64322E73 6F2E3000 763100 |rneed2.so.0.v1.|
77 # CHECK: 0x000000006FFFFFF0 VERSYM [[VERSYM]]
78 # CHECK-NEXT: 0x000000006FFFFFFE VERNEED [[VERNEED]]
79 # CHECK-NEXT: 0x000000006FFFFFFF VERNEEDNUM 2
81 # CHECK: DynamicSymbols [
82 # CHECK-NEXT: Symbol {
84 # CHECK-NEXT: Value: 0x0
86 # CHECK-NEXT: Binding: Local (0x0)
87 # CHECK-NEXT: Type: None (0x0)
88 # CHECK-NEXT: Other: 0
89 # CHECK-NEXT: Section: Undefined (0x0)
91 # CHECK-NEXT: Symbol {
92 # CHECK-NEXT: Name: f1@v3
93 # CHECK-NEXT: Value: 0x0
95 # CHECK-NEXT: Binding: Global (0x1)
96 # CHECK-NEXT: Type: None (0x0)
97 # CHECK-NEXT: Other: 0
98 # CHECK-NEXT: Section: Undefined (0x0)
100 # CHECK-NEXT: Symbol {
101 # CHECK-NEXT: Name: f2@v2
102 # CHECK-NEXT: Value: 0x0
103 # CHECK-NEXT: Size: 0
104 # CHECK-NEXT: Binding: Global (0x1)
105 # CHECK-NEXT: Type: None (0x0)
106 # CHECK-NEXT: Other: 0
107 # CHECK-NEXT: Section: Undefined (0x0)
109 # CHECK-NEXT: Symbol {
110 # CHECK-NEXT: Name: g1@v1
111 # CHECK-NEXT: Value: 0x0
112 # CHECK-NEXT: Size: 0
113 # CHECK-NEXT: Binding: Global (0x1)
114 # CHECK-NEXT: Type: None (0x0)
115 # CHECK-NEXT: Other: 0
116 # CHECK-NEXT: Section: Undefined (0x0)
120 # CHECK: VersionSymbols [
121 # CHECK-NEXT: Symbol {
122 # CHECK-NEXT: Version: 0
125 # CHECK-NEXT: Symbol {
126 # CHECK-NEXT: Version: 2
127 # CHECK-NEXT: Name: f1@v3
129 # CHECK-NEXT: Symbol {
130 # CHECK-NEXT: Version: 3
131 # CHECK-NEXT: Name: f2@v2
133 # CHECK-NEXT: Symbol {
134 # CHECK-NEXT: Version: 4
135 # CHECK-NEXT: Name: g1@v1
138 # CHECK-NEXT: VersionDefinitions [
140 # CHECK-NEXT: VersionRequirements [
141 # CHECK-NEXT: Dependency {
142 # CHECK-NEXT: Version: 1
143 # CHECK-NEXT: Count: 2
144 # CHECK-NEXT: FileName: verneed1.so.0
145 # CHECK-NEXT: Entries [
146 # CHECK-NEXT: Entry {
147 # CHECK-NEXT: Hash: 1938
148 # CHECK-NEXT: Flags [ (0x0)
150 # CHECK-NEXT: Index: 3
151 # CHECK-NEXT: Name: v2
153 # CHECK-NEXT: Entry {
154 # CHECK-NEXT: Hash: 1939
155 # CHECK-NEXT: Flags [ (0x0)
157 # CHECK-NEXT: Index: 2
158 # CHECK-NEXT: Name: v3
162 # CHECK-NEXT: Dependency {
163 # CHECK-NEXT: Version: 1
164 # CHECK-NEXT: Count: 1
165 # CHECK-NEXT: FileName: verneed2.so.0
166 # CHECK-NEXT: Entries [
167 # CHECK-NEXT: Entry {
168 # CHECK-NEXT: Hash: 1937
169 # CHECK-NEXT: Flags [ (0x0)
171 # CHECK-NEXT: Index: 4
172 # CHECK-NEXT: Name: v1