43 lines · plain
1# REQUIRES: x862 3# RUN: split-file %s %t4# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/exec.s -o %texec.o5# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/shared.s -o %tshared.o6# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/ledef.s -o %tdef.o7# RUN: ld.lld %texec.o -o %t.exec8# RUN: ld.lld %tshared.o -o %t.shared --shared9# RUN: llvm-objdump --no-print-imm-hex -d %t.exec | FileCheck %s --check-prefix=EXEC10# RUN: llvm-objdump --no-print-imm-hex -d %t.shared | FileCheck %s --check-prefix=SHARED11 12## An undefined weak TLS symbol does not fetch a lazy definition.13# RUN: ld.lld %texec.o --start-lib %tdef.o --end-lib -o %tlazy14# RUN: llvm-objdump --no-print-imm-hex -d %tlazy | FileCheck %s --check-prefix=EXEC15 16## Undefined TLS symbols arbitrarily resolve to 0.17# EXEC: leaq 16(%rax), %rdx18## Initial-exec references to undefined weak symbols can be relaxed to LE19## references.20# EXEC: leaq 32(%rax), %rax21# SHARED: leaq 48(%rax), %rcx22 23# RUN: ld.lld -shared %tdef.o -o %tdef.so24# RUN: not ld.lld %texec.o %tdef.so -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR %s25 26# ERROR: error: relocation R_X86_64_TPOFF32 cannot be used against symbol 'le'; recompile with -fPIC27 28#--- ledef.s29.tbss30.globl le31le:32 33#--- exec.s34.weak le35leaq le@tpoff+16(%rax), %rdx36 37.weak ie38addq ie@gottpoff+32(%rip), %rax39 40#--- shared.s41.weak ld42leaq ld@dtpoff+48(%rax), %rcx43