Files
TheRock/compiler/amd-llvm/lld/test/ELF/ppc64-tls-missing-gdld.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

131 lines
3.7 KiB
ArmAsm

# REQUIRES: ppc
# RUN: split-file %s %t
# RUN: llvm-mc --triple=ppc64le %t/a.s --filetype=obj -o %t/a.o
# RUN: llvm-mc --triple=ppc64le %t/b.s --filetype=obj -o %t/b.o
# RUN: llvm-mc --triple=ppc64le %t/tga.s --filetype=obj -o %t/tga.o
## User code can call __tls_get_addr by specifying the tls_index parameter.
## We need to allow R_PPC64_REL24/R_PPC64_REL24_NOTOC referencing __tls_get_addr
## without a pairing R_PPC64_TLSGD/R_PPC64_TLSLD.
# RUN: ld.lld --shared --fatal-warnings %t/b.o -o /dev/null
## Warn missing R_PPC64_TLSGD/R_PPC64_TLSLD.
# RUN: ld.lld --shared %t/a.o -o %t.so 2>&1 | FileCheck %s --check-prefix=WARN
# RUN: llvm-objdump -d --no-leading-addr %t.so | FileCheck %s --check-prefix=DIS
# RUN: ld.lld %t/a.o %t/tga.o -o %t2 2>&1 | FileCheck %s --check-prefix=WARN
# RUN: llvm-readelf -x .got %t2 | FileCheck %s --check-prefix=HEX
# RUN: llvm-objdump -d --no-leading-addr %t2 | FileCheck %s --check-prefix=DIS2
# WARN: warning: {{.*}}.o: disable TLS relaxation due to R_PPC64_GOT_TLS* relocations without R_PPC64_TLSGD/R_PPC64_TLSLD relocations
## .got+0: x is local - optimized to LE - its DTPMOD/DTPREL slots are link-time constants.
## DTPMOD is 1. DTPREL is st_value-0x8000 = -0x8000.
## .got+16: DTPMOD/DTPREL for _TLS_MODULE_BASE_ is 1 and 0, respectively.
## IE is relaxed to LE, so there is no TPOFFSET GOT entry.
# HEX: section '.got':
# HEX-NEXT: [[#%x,IGNORE:]] 50820210 00000000 01000000 00000000
# HEX-NEXT: [[#%x,IGNORE:]] 00000000 00000000 01000000 00000000
# HEX-NEXT: [[#%x,IGNORE:]] 0080ffff ffffffff
## .TOC.-32768 = (.got+0x8000)-32768 = .got
# DIS-LABEL: <GeneralDynamic>:
# DIS-NEXT: addis 3, 2, 0
# DIS-NEXT: addi 3, 3, -32744
# DIS-NEXT: bl [[#%x,TGA:]]
# DIS-LABEL: <GeneralDynamic_NOTOC>:
# DIS-NEXT: addis 3, 2, 0
# DIS-NEXT: addi 3, 3, -32744
# DIS-NEXT: bl [[#TGA]]
## LocalDynamic references _TLS_MODULE_BASE_.
## .TOC.-32752 = (.got+0x8000)-32752 = .got+16
# DIS-LABEL: <LocalDynamic>:
# DIS-NEXT: addis 3, 2, 0
# DIS-NEXT: addi 3, 3, -32760
# DIS-NEXT: bl [[#TGA]]
# DIS-LABEL: <LocalDynamic_NOTOC>:
# DIS-NEXT: addis 3, 2, 0
# DIS-NEXT: addi 3, 3, -32760
# DIS-NEXT: bl [[#TGA]]
## In the shared library case, IE is not optimized.
# DIS-LABEL: <InitialExec>:
# DIS-NEXT: addis 3, 2, 0
# DIS-NEXT: ld 3, -32728(3)
# DIS-NEXT: add 3, 3, 13
## .TOC.-32768 = (.got+0x8000)-32768 = .got
# DIS2-LABEL: <GeneralDynamic>:
# DIS2-NEXT: addis 3, 2, 0
# DIS2-NEXT: addi 3, 3, -32744
# DIS2-NEXT: bl [[#%x,TGA:]]
# DIS2-LABEL: <GeneralDynamic_NOTOC>:
# DIS2-NEXT: addis 3, 2, 0
# DIS2-NEXT: addi 3, 3, -32744
# DIS2-NEXT: bl [[#TGA]]
# DIS2-LABEL: <LocalDynamic>:
# DIS2-NEXT: addis 3, 2, 0
# DIS2-NEXT: addi 3, 3, -32760
# DIS2-NEXT: bl [[#TGA]]
# DIS2-LABEL: <LocalDynamic_NOTOC>:
# DIS2-NEXT: addis 3, 2, 0
# DIS2-NEXT: addi 3, 3, -32760
# DIS2-NEXT: bl [[#TGA]]
## IE to LE is relaxed even when GD/LD relaxation is disabled,
## since IE does not involve __tls_get_addr.
# DIS2-LABEL: <InitialExec>:
# DIS2-NEXT: nop
# DIS2-NEXT: addis 3, 13, 0
# DIS2-NEXT: addi 3, 3, -28672
#--- a.s
GeneralDynamic:
addis 3, 2, x@got@tlsgd@ha
addi 3, 3, x@got@tlsgd@l
bl __tls_get_addr
nop
GeneralDynamic_NOTOC:
addis 3, 2, x@got@tlsgd@ha
addi 3, 3, x@got@tlsgd@l
bl __tls_get_addr@notoc
nop
LocalDynamic:
addis 3, 2, x@got@tlsld@ha
addi 3, 3, x@got@tlsld@l
bl __tls_get_addr
nop
LocalDynamic_NOTOC:
addis 3, 2, x@got@tlsld@ha
addi 3, 3, x@got@tlsld@l
bl __tls_get_addr@notoc
nop
InitialExec:
addis 3, 2, x@got@tprel@ha
ld 3, x@got@tprel@l(3)
add 3, 3, x@tls
.globl _start
_start:
.section .tbss,"awT",@nobits
.globl x
x:
.quad 0
#--- b.s
CallOnly:
bl __tls_get_addr
nop
blr
#--- tga.s
.globl __tls_get_addr
__tls_get_addr:
blr