version-script-locals.s
1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: echo "VERSION_1.0 { local: foo1; };" > %t.script
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck --check-prefix=EXACT %s
# EXACT: DynamicSymbols [
# EXACT: _start
# EXACT-NOT: foo1
# EXACT: foo2
# EXACT: foo3
# RUN: echo "VERSION_1.0 { local: foo*; };" > %t.script
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck --check-prefix=WC %s
# WC: DynamicSymbols [
# WC: _start
# WC-NOT: foo1
# WC-NOT: foo2
# WC-NOT: foo3
# RUN: echo "VERSION_1.0 { global: *; local: foo*; };" > %t.script
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck --check-prefix=MIX %s
# MIX: DynamicSymbols [
# MIX: _start@@VERSION_1.0
# MIX-NOT: foo1
# MIX-NOT: foo2
# MIX-NOT: foo3
.globl foo1
foo1:
ret
.globl foo2
foo2:
ret
.globl foo3
foo3:
ret
.globl _start
_start:
ret