3 # RUN: split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/exec.s -o %texec.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/shared.s -o %tshared.o
6 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/ledef.s -o %tdef.o
7 # RUN: ld.lld %texec.o -o %t.exec
8 # RUN: ld.lld %tshared.o -o %t.shared --shared
9 # RUN: llvm-objdump --no-print-imm-hex -d %t.exec | FileCheck %s --check-prefix=EXEC
10 # RUN: llvm-objdump --no-print-imm-hex -d %t.shared | FileCheck %s --check-prefix=SHARED
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 %tlazy
14 # RUN: llvm-objdump --no-print-imm-hex -d %tlazy | FileCheck %s --check-prefix=EXEC
16 ## Undefined TLS symbols arbitrarily resolve to 0.
17 # EXEC: leaq 16(%rax), %rdx
18 ## Initial-exec references to undefined weak symbols can be relaxed to LE
20 # EXEC: leaq 32(%rax), %rax
21 # SHARED: leaq 48(%rax), %rcx
23 # RUN: ld.lld -shared %tdef.o -o %tdef.so
24 # RUN: not ld.lld %texec.o %tdef.so -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR %s
26 # ERROR: error: relocation R_X86_64_TPOFF32 cannot be used against symbol 'le'; recompile with -fPIC
35 leaq le@tpoff+
16(%rax
), %rdx
38 addq ie@gottpoff+
32(%rip
), %rax
42 leaq
ld@dtpoff+
48(%rax
), %rcx