blob: 1b296ef5bc8f804ea1971c7ce198e14426d26d5a [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 Rimar50dcece2016-07-16 12:26:39 +000067# DSO-NEXT: ]
68# DSO-NEXT: Version symbols {
69# DSO-NEXT: Section Name: .gnu.version
George Rimar84ba4ae2016-09-13 22:26:12 +000070# DSO-NEXT: Address: 0x240
71# DSO-NEXT: Offset: 0x240
George Rimar50dcece2016-07-16 12:26:39 +000072# DSO-NEXT: Link: 1
73# DSO-NEXT: Symbols [
74# DSO-NEXT: Symbol {
75# DSO-NEXT: Version: 0
76# DSO-NEXT: Name: @
77# DSO-NEXT: }
78# DSO-NEXT: Symbol {
79# DSO-NEXT: Version: 3
80# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
81# DSO-NEXT: }
82# DSO-NEXT: Symbol {
83# DSO-NEXT: Version: 2
84# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
85# DSO-NEXT: }
86# DSO-NEXT: Symbol {
87# DSO-NEXT: Version: 2
88# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
89# DSO-NEXT: }
Ed Maste5ad1cbe2016-09-07 17:51:00 +000090# DSO-NEXT: Symbol {
91# DSO-NEXT: Version: 2
92# DSO-NEXT: Name: _ZN3abcC1Ev@@LIBSAMPLE_1.0
93# DSO-NEXT: }
George Rimar50dcece2016-07-16 12:26:39 +000094# DSO-NEXT: ]
95# DSO-NEXT: }
96
97.text
98.globl _Z3fooi
99.type _Z3fooi,@function
100_Z3fooi:
101retq
102
103.globl _Z3bari
104.type _Z3bari,@function
105_Z3bari:
106retq
107
108.globl _Z3zedi
109.type _Z3zedi,@function
110_Z3zedi:
111retq
Ed Maste5ad1cbe2016-09-07 17:51:00 +0000112
113.globl _ZN3abcC1Ev
114.type _ZN3abcC1Ev,@function
115_ZN3abcC1Ev:
116retq