2 # RUN: split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/b.s -o %t/b.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/c.s -o %t/c.o
6 # RUN: ld.lld -shared -soname=b -Ttext=0 %t/b.o -o %t/b.so
8 # RUN: ld.lld %t/a.o %t/b.so -o %t1
9 # RUN: llvm-readelf -r -s %t1 | FileCheck %s
11 ## In %t/b.so, foo has st_value==0 and its section alignment is 0x400. The
12 ## alignment of the copy relocated foo is thus 0x400.
13 # CHECK: R_X86_64_COPY {{.*}} foo + 0
14 # CHECK: 0000000000203400 4 OBJECT GLOBAL DEFAULT [[#]] foo
16 ## Error if attempting to copy relocate a SHN_ABS symbol (even if st_size is non-zero).
17 # RUN: ld.lld -shared -soname=c %t/c.o -o %t/c.so
18 # RUN: llvm-readelf -s %t/c.so | FileCheck %s --check-prefix=ABSADDR
19 # RUN: not ld.lld %t/a.o %t/c.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR
21 # ABSADDR: 0000000000000000 4 OBJECT GLOBAL DEFAULT ABS foo
22 # ERR: error: cannot create a copy relocation for symbol foo