Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
lld/test/ELF/aarch64-tls-le.s
# REQUIRES: aarch64 | # REQUIRES: aarch64 | ||||
# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %tmain.o | # RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %tmain.o | ||||
# RUN: ld.lld %tmain.o -o %tout | # RUN: ld.lld %tmain.o -o %tout | ||||
# RUN: llvm-objdump -d %tout | FileCheck %s | # RUN: llvm-objdump -d %tout | FileCheck %s | ||||
# RUN: llvm-readobj -S -r %tout | FileCheck -check-prefix=RELOC %s | # RUN: llvm-readobj -S -r %tout | FileCheck -check-prefix=RELOC %s | ||||
#Local-Dynamic to Local-Exec relax creates no | #Local-Dynamic to Local-Exec relax creates no | ||||
#RELOC: Relocations [ | #RELOC: Relocations [ | ||||
#RELOC-NEXT: ] | #RELOC-NEXT: ] | ||||
## Reject local-exec TLS relocations for -shared. | |||||
# RUN: not ld.lld -shared %tmain.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error: | |||||
# ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_HI12 against v1 cannot be used with -shared | |||||
# ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC against v1 cannot be used with -shared | |||||
# ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_HI12 against v2 cannot be used with -shared | |||||
# ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC against v2 cannot be used with -shared | |||||
.globl _start | .globl _start | ||||
_start: | _start: | ||||
mrs x0, TPIDR_EL0 | mrs x0, TPIDR_EL0 | ||||
add x0, x0, :tprel_hi12:v1 | add x0, x0, :tprel_hi12:v1 | ||||
add x0, x0, :tprel_lo12_nc:v1 | add x0, x0, :tprel_lo12_nc:v1 | ||||
mrs x0, TPIDR_EL0 | mrs x0, TPIDR_EL0 | ||||
add x0, x0, :tprel_hi12:v2 | add x0, x0, :tprel_hi12:v2 | ||||
add x0, x0, :tprel_lo12_nc:v2 | add x0, x0, :tprel_lo12_nc:v2 | ||||
Show All 30 Lines |