42 lines · plain
1# REQUIRES: x862## Test R_X86_64_PLTOFF64 (preemptible: L - GOT + A; non-preemptible: S - GOT + A).3 4# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o5# RUN: ld.lld %t.o -shared -o %t.so6# RUN: llvm-readelf -S %t.so | FileCheck %s --check-prefix=SEC-SHARED7# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s --check-prefix=SHARED8 9# RUN: ld.lld %t.o -o %t10# RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SEC-PDE11# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s --check-prefix=PDE12 13# SEC-SHARED: .got.plt PROGBITS 00000000000033c0 0003c0 00002814 15## foo@plt - .got.plt = 0x12f0 - 0x33c0 = -840016## undefweak@plt - .got.plt = 0x1300 - 0x33c0 = -838417# SHARED-LABEL: <.text>:18# SHARED-NEXT: movabsq $-8400, %rdx19# SHARED-NEXT: movabsq $-8384, %rdx20# SHARED-LABEL: <foo@plt>:21# SHARED-NEXT: 12f0: jmpq {{.*}}(%rip)22 23# SEC-PDE: .got.plt PROGBITS 0000000000202170 000170 00001824 25## Avoid PLT since the referenced symbol is non-preemptible.26## foo - .got.plt = 0x20116c - 0x202170 = -410027## 0 - .got.plt = 0 - 0x202168 = -210571228# PDE-LABEL: <.text>:29# PDE-NEXT: movabsq $-4100, %rdx30# PDE-NEXT: movabsq $-2105712, %rdx31# PDE-LABEL: <foo>:32# PDE-NEXT: 20116c: retq33 34 movabsq $foo@PLTOFF, %rdx35 movabsq $undefweak@PLTOFF, %rdx36 37.globl foo38foo:39 ret40 41.weak undefweak42