2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4 # RUN: echo "bar = foo; VERSION { V { global: foo; bar; local: *; }; }" > %t.script
5 # RUN: ld.lld -T %t.script -shared --no-undefined-version %t.o -o %t.so
6 # RUN: llvm-readobj -V %t.so | FileCheck %s
8 # RUN: echo "SECTIONS { .text : { bar = foo; *(.text) } }" > %t.script
9 # RUN: echo "VERSION { V { global: foo; bar; local: *; }; }" >> %t.script
10 # RUN: ld.lld -T %t.script -shared --no-undefined-version %t.o -o %t.so
11 # RUN: llvm-readobj -V %t.so | FileCheck %s
13 ## Check that we are able to version symbols defined in script.
14 # CHECK: VersionSymbols [
15 # CHECK-NEXT: Symbol {
16 # CHECK-NEXT: Version: 0
19 # CHECK-NEXT: Symbol {
20 # CHECK-NEXT: Version: 1
21 # CHECK-NEXT: Name: und
23 # CHECK-NEXT: Symbol {
24 # CHECK-NEXT: Version: 2
25 # CHECK-NEXT: Name: foo@@V
27 # CHECK-NEXT: Symbol {
28 # CHECK-NEXT: Version: 2
29 # CHECK-NEXT: Name: bar@@V
33 # RUN: echo "bar = und; VERSION { V { global: foo; bar; local: *; }; }" > %t.script
34 # RUN: not ld.lld -T %t.script -shared --no-undefined-version %t.o -o /dev/null \
35 # RUN: 2>&1 | FileCheck --check-prefix=ERR %s
36 # ERR: symbol not found: und
38 # RUN: echo "und = 0x1; VERSION { V { global: und; local: *; }; }" > %t.script
39 # RUN: ld.lld -T %t.script -shared --no-undefined-version %t.o -o %t.so
40 # RUN: llvm-readobj -V %t.so | FileCheck %s --check-prefix=UNDEF
41 # UNDEF: VersionSymbols [
42 # UNDEF-NEXT: Symbol {
43 # UNDEF-NEXT: Version: 0
46 # UNDEF-NEXT: Symbol {
47 # UNDEF-NEXT: Version: 2
48 # UNDEF-NEXT: Name: und@@V