44 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o3# RUN: llvm-mc -filetype=obj -triple=x86_64 %p/Inputs/shared.s -o %t2.o4# RUN: ld.lld %t2.o -shared -o %t2.so --threads=15# RUN: not ld.lld -pie %t.o %t2.so -o /dev/null --threads=1 2>&1 | FileCheck %s6# RUN: not ld.lld -shared %t.o %t2.so -o /dev/null --threads=1 2>&1 | FileCheck %s7 8# CHECK: error: relocation R_X86_64_32 cannot be used against symbol 'zed'; recompile with -fPIC9# CHECK-NEXT: >>> defined in {{.*}}.so10# CHECK-NEXT: >>> referenced by {{.*}}.o:(.data+0x0)11# CHECK-EMPTY:12# CHECK-NEXT: error: relocation R_X86_64_PC32 cannot be used against symbol 'zed'; recompile with -fPIC13# CHECK-NEXT: >>> defined in {{.*}}.so14# CHECK-NEXT: >>> referenced by {{.*}}.o:(.data+0x4)15# CHECK-EMPTY:16# CHECK-NEXT: error: relocation R_X86_64_64 cannot be used against symbol '_start'; recompile with -fPIC17# CHECK: error: relocation R_X86_64_64 cannot be used against symbol 'main'; recompile with -fPIC18# CHECK: error: relocation R_X86_64_64 cannot be used against symbol 'data'; recompile with -fPIC19# CHECK-NOT: error:20 21# RUN: ld.lld --noinhibit-exec %t.o %t2.so -o /dev/null 2>&1 | FileCheck --check-prefix=WARN %s22# RUN: not ld.lld --export-dynamic --unresolved-symbols=ignore-all %t.o %t2.so -o /dev/null 2>&1 | FileCheck --check-prefix=WARN %s23 24# WARN: relocation R_X86_64_32 cannot be used against symbol 'zed'; recompile with -fPIC25# WARN: relocation R_X86_64_PC32 cannot be used against symbol 'zed'; recompile with -fPIC26 27 .global _start, main, data28 .type main, @function29 .type data, @object30_start:31 ret32main:33 ret34 35.data36data:37.long zed38.long zed - .39 40.rodata41.quad _start42.quad main43.quad data44