xref: /llvm-project/lld/test/ELF/linkerscript/provide-shared.s (revision 215c5656449c8e817a3759d989f27ba39d711cbd)
1# REQUIRES: x86
2# RUN: rm -rf %t && split-file %s %t && cd %t
3# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
4# RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o
5# RUN: ld.lld b.o -o b.so -shared -soname=b.so
6# RUN: ld.lld -T a.t a.o b.so -o a
7# RUN: llvm-readelf -s a | FileCheck  %s
8
9# CHECK: 000000000000002a 0 NOTYPE GLOBAL DEFAULT ABS f1
10# CHECK: 000000000000002a 0 NOTYPE GLOBAL DEFAULT ABS f2
11
12#--- a.s
13.global _start
14_start:
15.quad f1
16
17#--- b.s
18.global f1
19.size f1, 8
20.type f1, @object
21f1:
22.quad 42
23
24.global f2
25.data
26.dc.a f2
27
28#--- a.t
29SECTIONS {
30  . = . + SIZEOF_HEADERS;
31  PROVIDE(f1 = 42);
32  PROVIDE(f2 = 42);
33}
34