]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/version-undef-sym.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / version-undef-sym.s
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 // RUN: llvm-readobj --dyn-symbols %p/Inputs/version-undef-sym.so | FileCheck %s
4
5
6 // Inputs/version-undef-sym.so consists of the assembly file
7 //
8 //         .global bar
9 // bar:
10 //        .weak abc1
11 //        .weak abc2
12 //        .weak abc3
13 //        .weak abc4
14 //        .weak abc5
15 //
16 // linked into a shared library with the version script
17 //
18 // VER_1 {
19 // global:
20 //   bar;
21 // };
22 //
23 // Assuming we can reproduce the desired property (a few undefined symbols
24 // before bar) we should create it with lld itself once it supports that.
25
26
27 // Show that the input .so has undefined symbols before bar. That is what would
28 // get our version parsing out of sync.
29
30 // CHECK: Section: Undefined
31 // CHECK: Section: Undefined
32 // CHECK: Section: Undefined
33 // CHECK: Section: Undefined
34 // CHECK: Section: Undefined
35 // CHECK: Name: bar
36
37 // But now we can successfully find bar.
38 // RUN: ld.lld %t.o %p/Inputs/version-undef-sym.so -o /dev/null
39
40         .global _start
41 _start:
42         call bar@plt