blob: 4db121d330e3d6c0d0c00f4893c258ed798de9b8 [file] [log] [blame]
George Rimar8825a5c2016-09-07 09:59:29 +00001# REQUIRES: x86
George Rimar50dcece2016-07-16 12:26:39 +00002
3# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
4# RUN: echo "LIBSAMPLE_1.0 { \
5# RUN: global: \
George Rimar8825a5c2016-09-07 09:59:29 +00006# RUN: extern \"C++\" { \
7# RUN: \"foo(int)\"; \
8# RUN: \"zed(int)\"; \
Ed Maste5ad1cbe2016-09-07 17:51:00 +00009# RUN: \"abc::abc()\"; \
George Rimar50dcece2016-07-16 12:26:39 +000010# RUN: }; \
11# RUN: }; \
12# RUN: LIBSAMPLE_2.0 { \
13# RUN: global: \
George Rimar8825a5c2016-09-07 09:59:29 +000014# RUN: extern \"C++\" { \
15# RUN: \"bar(int)\"; \
George Rimar50dcece2016-07-16 12:26:39 +000016# RUN: }; \
17# RUN: }; " > %t.script
18# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
19# RUN: llvm-readobj -V -dyn-symbols %t.so | FileCheck --check-prefix=DSO %s
20
21# DSO: DynamicSymbols [
22# DSO-NEXT: Symbol {
23# DSO-NEXT: Name: @
24# DSO-NEXT: Value: 0x0
25# DSO-NEXT: Size: 0
26# DSO-NEXT: Binding: Local
27# DSO-NEXT: Type: None
28# DSO-NEXT: Other: 0
29# DSO-NEXT: Section: Undefined
30# DSO-NEXT: }
31# DSO-NEXT: Symbol {
32# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
33# DSO-NEXT: Value: 0x1001
34# DSO-NEXT: Size: 0
35# DSO-NEXT: Binding: Global
36# DSO-NEXT: Type: Function
37# DSO-NEXT: Other: 0
38# DSO-NEXT: Section: .text
39# DSO-NEXT: }
40# DSO-NEXT: Symbol {
41# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
42# DSO-NEXT: Value: 0x1000
43# DSO-NEXT: Size: 0
44# DSO-NEXT: Binding: Global
45# DSO-NEXT: Type: Function
46# DSO-NEXT: Other: 0
47# DSO-NEXT: Section: .text
48# DSO-NEXT: }
49# DSO-NEXT: Symbol {
50# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
51# DSO-NEXT: Value: 0x1002
52# DSO-NEXT: Size: 0
53# DSO-NEXT: Binding: Global (0x1)
54# DSO-NEXT: Type: Function (0x2)
55# DSO-NEXT: Other: 0
56# DSO-NEXT: Section: .text (0x6)
57# DSO-NEXT: }
Ed Maste5ad1cbe2016-09-07 17:51:00 +000058# DSO-NEXT: Symbol {
59# DSO-NEXT: Name: _ZN3abcC1Ev@@LIBSAMPLE_1.0
60# DSO-NEXT: Value: 0x1003
61# DSO-NEXT: Size: 0
62# DSO-NEXT: Binding: Global (0x1)
63# DSO-NEXT: Type: Function (0x2)
64# DSO-NEXT: Other: 0
65# DSO-NEXT: Section: .text (0x6)
66# DSO-NEXT: }
George Rimar31c25ae2016-09-15 12:44:38 +000067# DSO-NEXT: Symbol {
68# DSO-NEXT: Name: _ZN3abcC2Ev@@LIBSAMPLE_1.0
69# DSO-NEXT: Value: 0x1004
70# DSO-NEXT: Size: 0
71# DSO-NEXT: Binding: Global (0x1)
72# DSO-NEXT: Type: Function (0x2)
73# DSO-NEXT: Other: 0
74# DSO-NEXT: Section: .text (0x6)
75# DSO-NEXT: }
George Rimar50dcece2016-07-16 12:26:39 +000076# DSO-NEXT: ]
77# DSO-NEXT: Version symbols {
78# DSO-NEXT: Section Name: .gnu.version
George Rimar31c25ae2016-09-15 12:44:38 +000079# DSO-NEXT: Address: 0x258
80# DSO-NEXT: Offset: 0x258
George Rimar50dcece2016-07-16 12:26:39 +000081# DSO-NEXT: Link: 1
82# DSO-NEXT: Symbols [
83# DSO-NEXT: Symbol {
84# DSO-NEXT: Version: 0
85# DSO-NEXT: Name: @
86# DSO-NEXT: }
87# DSO-NEXT: Symbol {
88# DSO-NEXT: Version: 3
89# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
90# DSO-NEXT: }
91# DSO-NEXT: Symbol {
92# DSO-NEXT: Version: 2
93# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
94# DSO-NEXT: }
95# DSO-NEXT: Symbol {
96# DSO-NEXT: Version: 2
97# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
98# DSO-NEXT: }
Ed Maste5ad1cbe2016-09-07 17:51:00 +000099# DSO-NEXT: Symbol {
100# DSO-NEXT: Version: 2
101# DSO-NEXT: Name: _ZN3abcC1Ev@@LIBSAMPLE_1.0
102# DSO-NEXT: }
George Rimar31c25ae2016-09-15 12:44:38 +0000103# DSO-NEXT: Symbol {
104# DSO-NEXT: Version: 2
105# DSO-NEXT: Name: _ZN3abcC2Ev@@LIBSAMPLE_1.0
106# DSO-NEXT: }
George Rimar50dcece2016-07-16 12:26:39 +0000107# DSO-NEXT: ]
108# DSO-NEXT: }
109
110.text
111.globl _Z3fooi
112.type _Z3fooi,@function
113_Z3fooi:
114retq
115
116.globl _Z3bari
117.type _Z3bari,@function
118_Z3bari:
119retq
120
121.globl _Z3zedi
122.type _Z3zedi,@function
123_Z3zedi:
124retq
Ed Maste5ad1cbe2016-09-07 17:51:00 +0000125
126.globl _ZN3abcC1Ev
127.type _ZN3abcC1Ev,@function
128_ZN3abcC1Ev:
129retq
George Rimar31c25ae2016-09-15 12:44:38 +0000130
131.globl _ZN3abcC2Ev
132.type _ZN3abcC2Ev,@function
133_ZN3abcC2Ev:
134retq