3 # RUN: rm -rf %t && split-file %s %t && cd %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/verdef-defaultver.s -o %t1
5 # RUN: echo "V1 { global: a; b; local: *; };" > %t.script
6 # RUN: echo "V2 { global: b; c; } V1;" >> %t.script
7 # RUN: ld.lld --hash-style=sysv -shared -soname shared %t1 --version-script %t.script --undefined-version -o %t.so
8 # RUN: llvm-readobj -V --dyn-syms %t.so | FileCheck --check-prefix=DSO %s
10 # DSO: DynamicSymbols [
13 # DSO-NEXT: Value: 0x0
15 # DSO-NEXT: Binding: Local
16 # DSO-NEXT: Type: None
18 # DSO-NEXT: Section: Undefined
21 # DSO-NEXT: Name: b@V1
22 # DSO-NEXT: Value: 0x12E9
24 # DSO-NEXT: Binding: Global
25 # DSO-NEXT: Type: Function
27 # DSO-NEXT: Section: .text
30 # DSO-NEXT: Name: b@@V2
31 # DSO-NEXT: Value: 0x12EA
33 # DSO-NEXT: Binding: Global
34 # DSO-NEXT: Type: Function
36 # DSO-NEXT: Section: .text
39 # DSO-NEXT: Name: a@@V1
40 # DSO-NEXT: Value: 0x12E8
42 # DSO-NEXT: Binding: Global
43 # DSO-NEXT: Type: Function
45 # DSO-NEXT: Section: .text
48 # DSO-NEXT: Name: c@@V2
49 # DSO-NEXT: Value: 0x12EB
51 # DSO-NEXT: Binding: Global
52 # DSO-NEXT: Type: Function
54 # DSO-NEXT: Section: .text
57 # DSO-NEXT: VersionSymbols [
59 # DSO-NEXT: Version: 0
63 # DSO-NEXT: Version: 2
64 # DSO-NEXT: Name: b@V1
67 # DSO-NEXT: Version: 3
68 # DSO-NEXT: Name: b@@V2
71 # DSO-NEXT: Version: 2
72 # DSO-NEXT: Name: a@@V1
75 # DSO-NEXT: Version: 3
76 # DSO-NEXT: Name: c@@V2
79 # DSO-NEXT: VersionDefinitions [
80 # DSO-NEXT: Definition {
81 # DSO-NEXT: Version: 1
82 # DSO-NEXT: Flags [ (0x1)
83 # DSO-NEXT: Base (0x1)
86 # DSO-NEXT: Hash: 127830196
87 # DSO-NEXT: Name: shared
88 # DSO-NEXT: Predecessors: []
90 # DSO-NEXT: Definition {
91 # DSO-NEXT: Version: 1
92 # DSO-NEXT: Flags [ (0x0)
95 # DSO-NEXT: Hash: 1425
97 # DSO-NEXT: Predecessors: []
99 # DSO-NEXT: Definition {
100 # DSO-NEXT: Version: 1
101 # DSO-NEXT: Flags [ (0x0)
104 # DSO-NEXT: Hash: 1426
106 # DSO-NEXT: Predecessors: []
110 ## Check that we can link against DSO produced.
111 # RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
112 # RUN: ld.lld --hash-style=sysv a.o %t.so -o a
113 # RUN: llvm-readobj -V --dyn-syms a | FileCheck --check-prefix=EXE %s
115 # EXE: DynamicSymbols [
118 # EXE-NEXT: Value: 0x0
120 # EXE-NEXT: Binding: Local
121 # EXE-NEXT: Type: None
123 # EXE-NEXT: Section: Undefined
126 # EXE-NEXT: Name: a@V1
127 # EXE-NEXT: Value: 0x201340
129 # EXE-NEXT: Binding: Global
130 # EXE-NEXT: Type: Function
132 # EXE-NEXT: Section: Undefined
135 # EXE-NEXT: Name: b@V2
136 # EXE-NEXT: Value: 0x201350
138 # EXE-NEXT: Binding: Global
139 # EXE-NEXT: Type: Function
141 # EXE-NEXT: Section: Undefined
144 # EXE-NEXT: Name: c@V2
145 # EXE-NEXT: Value: 0x201360
147 # EXE-NEXT: Binding: Global
148 # EXE-NEXT: Type: Function
150 # EXE-NEXT: Section: Undefined
153 # EXE-NEXT: VersionSymbols [
155 # EXE-NEXT: Version: 0
159 # EXE-NEXT: Version: 2
160 # EXE-NEXT: Name: a@V1
163 # EXE-NEXT: Version: 3
164 # EXE-NEXT: Name: b@V2
167 # EXE-NEXT: Version: 3
168 # EXE-NEXT: Name: c@V2
171 # EXE-NEXT: VersionDefinitions [
173 # EXE-NEXT: VersionRequirements [
174 # EXE-NEXT: Dependency {
175 # EXE-NEXT: Version: 1
177 # EXE-NEXT: FileName: shared
178 # EXE-NEXT: Entries [
180 # EXE-NEXT: Hash: 1425
181 # EXE-NEXT: Flags [ (0x0)
187 # EXE-NEXT: Hash: 1426
188 # EXE-NEXT: Flags [ (0x0)
197 # RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o
198 # RUN: ld.lld -shared --version-script=%t.script --fatal-warnings --undefined-version %t.so b.o -o b.so
199 # RUN: llvm-readelf --dyn-syms b.so | FileCheck %s --check-prefix=PREEMPT
200 # RUN: ld.lld -shared --version-script=%t.script --fatal-warnings --undefined-version b.o %t.so -o b.so
201 # RUN: llvm-readelf --dyn-syms b.so | FileCheck %s --check-prefix=PREEMPT