Files
TheRock/compiler/amd-llvm/lld/test/ELF/ppc64-long-branch-pi.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

94 lines
3.4 KiB
ArmAsm

# REQUIRES: ppc
# RUN: llvm-mc -filetype=obj -triple=ppc64le %s -o %t.o
# RUN: echo 'SECTIONS { \
# RUN: .text_low 0x2000: { *(.text_low) } \
# RUN: .text_high 0x2002000 : { *(.text_high) } \
# RUN: }' > %t.script
# RUN: ld.lld -pie -T %t.script %t.o -o %t
# RUN: llvm-readelf -S %t | FileCheck --check-prefix=SEC-PIE %s
# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
## RELATIVE relocs relocating NOBITS .branch_lt do not cause --check-dynamic-relocations errors.
# RUN: ld.lld -shared -T %t.script %t.o -o %t.so --apply-dynamic-relocs --check-dynamic-relocations
# RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=SEC-SHARED %s
# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
# SEC-PIE: Name Type Address Off Size ES Flg Lk Inf Al
# SEC-PIE: .got PROGBITS 0000000002002120 2012120 000010 00 WA 0 0 8
# SEC-PIE: .branch_lt NOBITS 0000000002002138 2012138 000020 00 WA 0 0 8
# SEC-SHARED: Name Type Address Off Size ES Flg Lk Inf Al
# SEC-SHARED: .got PROGBITS 0000000002002100 2012100 000010 00 WA 0 0 8
# SEC-SHARED: .branch_lt NOBITS 0000000002002118 2012118 000020 00 WA 0 0 8
# RELOC: .rela.dyn {
# RELOC-NEXT: 0x2002128 R_PPC64_RELATIVE - 0x2002000
# RELOC-NEXT: 0x2002130 R_PPC64_RELATIVE - 0x2012120
# RELOC-NEXT: 0x2002138 R_PPC64_RELATIVE - 0x2002000
# RELOC-NEXT: 0x2002140 R_PPC64_RELATIVE - 0x2002008
# RELOC-NEXT: 0x2002148 R_PPC64_RELATIVE - 0x200200C
# RELOC-NEXT: 0x2002150 R_PPC64_RELATIVE - 0x2000
# RELOC-NEXT: }
# CHECK: <_start>:
# CHECK-NEXT: 2000: bl 0x2010
# CHECK-NEXT: bl 0x2002000
# CHECK-NEXT: bl 0x2030
# CHECK-NEXT: bl 0x2050
## &.branch_lt[0] - .TOC. = .branch_lt - (.got+0x8000) = -32744
# CHECK: <__long_branch_>:
# CHECK-NEXT: 2010: addis 12, 2, 0
# CHECK-NEXT: ld 12, -32744(12)
# CHECK-NEXT: mtctr 12
# CHECK-NEXT: bctr
## &.branch_lt[1] - .TOC. = .branch_lt - (.got+0x8000) = -32736
# CHECK: <__long_branch_>:
# CHECK-NEXT: 2030: addis 12, 2, 0
# CHECK-NEXT: ld 12, -32736(12)
# CHECK-NEXT: mtctr 12
# CHECK-NEXT: bctr
## &.branch_lt[2] - .TOC. = .branch_lt - (.got+0x8000) = -32728
# CHECK: <__long_branch_>:
# CHECK-NEXT: 2050: addis 12, 2, 0
# CHECK-NEXT: ld 12, -32728(12)
# CHECK-NEXT: mtctr 12
# CHECK-NEXT: bctr
.section .text_low, "ax", %progbits
.globl _start
_start:
bl .text_high # Need a thunk
bl .text_high
bl .text_high+8 # Need a thunk
bl .text_high+0xc # Need a thunk
# CHECK: <high_target>:
# CHECK-NEXT: 2002000: bl 0x2004
# CHECK-NEXT: bl 0x2004
# CHECK-NEXT: bl 0x2002020
## &.branch_lt[3] - .TOC. = .branch_lt - (.got+0x8000) = -32720
# CHECK: <__long_branch_>:
# CHECK-NEXT: 2002020: addis 12, 2, 0
# CHECK-NEXT: ld 12, -32720(12)
# CHECK-NEXT: mtctr 12
# CHECK-NEXT: bctr
.section .text_high, "ax", %progbits
high_target:
bl .text_low+4
bl .text_low+4
bl .text_low # Need a thunk
blr
## Force creation of .got
addis 3, 2, .text_high@got@ha
## The R_PPC64_RELATIVE makes sure .rela.dyn survives removeUnusedSyntheticSections.
.section .data
.quad .TOC.@tocbase