xref: /llvm-project/lld/test/ELF/version-script-noundef.s (revision 241dbd310599e3c1a0f1b0c9ced14c8b8760539e)
1# REQUIRES: x86
2
3# RUN: echo "VERSION_1.0 { global: bar; };" > %t.script
4# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
5# RUN: not ld.lld --version-script %t.script -shared %t.o -o /dev/null \
6# RUN:    --fatal-warnings 2>&1 | FileCheck -check-prefix=ERR1 %s
7# RUN: ld.lld --version-script %t.script -shared --undefined-version %t.o -o %t.so
8# RUN: not ld.lld --version-script %t.script -shared --no-undefined-version \
9# RUN:   %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR1 %s
10# ERR1: version script assignment of 'VERSION_1.0' to symbol 'bar' failed: symbol not defined
11
12# RUN: echo "VERSION_1.0 { global: und; };" > %t2.script
13# RUN: not ld.lld --version-script %t2.script -shared --no-undefined-version \
14# RUN:   %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR2 %s
15# ERR2: version script assignment of 'VERSION_1.0' to symbol 'und' failed: symbol not defined
16
17# RUN: echo "VERSION_1.0 { local: und; };" > %t3.script
18# RUN: not ld.lld --version-script %t3.script -shared --no-undefined-version \
19# RUN:   %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR3 %s
20# ERR3: version script assignment of 'local' to symbol 'und' failed: symbol not defined
21
22## Wildcard patterns do not error.
23# RUN: echo "VERSION_1.0 { global: b*; local: u*; };" > %t4.script
24# RUN: ld.lld --version-script %t4.script -shared --no-undefined-version --fatal-warnings %t.o -o /dev/null
25
26.text
27.globl foo
28.type foo,@function
29foo:
30callq und@PLT
31