Files
TheRock/compiler/amd-llvm/lld/test/ELF/aarch64-tlsdesc-zrel.s
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

63 lines
2.2 KiB
ArmAsm

/// Check that we write addends for AArch64 TLSDESC relocations with -z rel
/// See https://bugs.llvm.org/show_bug.cgi?id=47009
// REQUIRES: aarch64
// RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o
// RUN: ld.lld -shared %t.o -o %t-rela.so
// RUN: llvm-readobj -W -r -x .got %t-rela.so | FileCheck %s --check-prefixes=RELA,RELA-NO-ADDENDS
// RUN: ld.lld -shared %t.o -o %t-rela-addends.so --apply-dynamic-relocs
// RUN: llvm-readobj -W -r -x .got %t-rela-addends.so | FileCheck %s --check-prefixes=RELA,RELA-WITH-ADDENDS
// RELA: Relocations [
// RELA-NEXT: Section (5) .rela.dyn {
// RELA-NEXT: 0x[[#%x,ADDR:]] R_AARCH64_TLSDESC - 0x0
// RELA-NEXT: 0x[[#ADDR+16]] R_AARCH64_TLSDESC - 0x4
// RELA-NEXT: }
// RELA-NEXT: ]
// RELA-EMPTY:
// RELA-NEXT: Hex dump of section '.got':
// RELA-NEXT: 0x000[[#ADDR]] 00000000 00000000 00000000 00000000
// RELA-NO-ADDENDS-NEXT: 0x000[[#ADDR+16]] 00000000 00000000 00000000 00000000
// RELA-WITH-ADDENDS-NEXT: 0x000[[#ADDR+16]] 00000000 00000000 04000000 00000000
/// Addend 0x4 for R_AARCH64_TLSDESC -----^
// RELA-EMPTY:
// RUN: ld.lld -shared %t.o -o %t-rel.so -z rel
// RUN: llvm-readobj -W -r -x .got %t-rel.so | FileCheck %s --check-prefix=REL
// REL: Relocations [
// REL-NEXT: Section (5) .rel.dyn {
// REL-NEXT: 0x[[#%x,ADDR:]] R_AARCH64_TLSDESC -{{$}}
// REL-NEXT: 0x[[#ADDR+16]] R_AARCH64_TLSDESC -{{$}}
// REL-NEXT: }
// REL-NEXT: ]
// REL-EMPTY:
// REL-NEXT: Hex dump of section '.got':
// REL-NEXT: 0x000[[#ADDR]] 00000000 00000000 00000000 00000000
// REL-NEXT: 0x000[[#ADDR+16]] 00000000 00000000 04000000 00000000
/// Addend 0x4 for R_AARCH64_TLSDESC -----^
// REL-EMPTY:
.text
foo:
adrp x0, :tlsdesc:x
ldr x1, [x0, :tlsdesc_lo12:x]
add x0, x0, :tlsdesc_lo12:x
.tlsdesccall x
blr x1
adrp x0, :tlsdesc:y
ldr x1, [x0, :tlsdesc_lo12:y]
add x0, x0, :tlsdesc_lo12:y
.tlsdesccall y
blr x1
ret
.section .tbss,"awT",@nobits
.p2align 2
.hidden x
x:
.word 0
.p2align 2
.hidden y
y:
.word 0