Files
TheRock/compiler/amd-llvm/lld/test/ELF/ppc32-canonical-plt.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

86 lines
2.6 KiB
ArmAsm

# REQUIRES: ppc
## Test that we create canonical PLT entries for -no-pie.
# RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o
# RUN: llvm-mc -filetype=obj -triple=powerpc %p/Inputs/canonical-plt-pcrel.s -o %t1.o
# RUN: ld.lld %t1.o -o %t1.so -shared -soname=so
# RUN: ld.lld %t.o %t1.so -o %t
# RUN: llvm-readobj -r %t | FileCheck --check-prefix=REL %s
# RUN: llvm-readelf -S -s %t | FileCheck --check-prefix=SYM %s
# RUN: llvm-readelf -x .plt %t | FileCheck --check-prefix=HEX %s
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
# REL: Relocations [
# REL-NEXT: .rela.plt {
# REL-NEXT: 0x10030318 R_PPC_JMP_SLOT func 0x0
# REL-NEXT: 0x1003031C R_PPC_JMP_SLOT func2 0x0
# REL-NEXT: 0x10030320 R_PPC_JMP_SLOT ifunc 0x0
# REL-NEXT: }
# REL-NEXT: ]
# SYM: .glink PROGBITS 1001022c
## st_value points to the canonical PLT entry in .glink
# SYM: Symbol table '.dynsym'
# SYM: 1001022c 0 FUNC GLOBAL DEFAULT UND func
# SYM: 1001023c 0 FUNC GLOBAL DEFAULT UND func2
# SYM: 1001024c 0 FUNC GLOBAL DEFAULT UND ifunc
# SYM: Symbol table '.symtab'
# SYM: 1001022c 0 FUNC GLOBAL DEFAULT UND func
# SYM: 1001023c 0 FUNC GLOBAL DEFAULT UND func2
# SYM: 1001024c 0 FUNC GLOBAL DEFAULT UND ifunc
# HEX: 0x10030318 1001025c 10010260 10010264
## Canonical PLT entry of func.
## 0x10030318 = 65536*4099+792
# CHECK: 1001022c <.glink>:
# CHECK-NEXT: lis 11, 4099
# CHECK-NEXT: lwz 11, 792(11)
# CHECK-NEXT: mtctr 11
# CHECK-NEXT: bctr
## Canonical PLT entry of func2.
## 0x1003031C = 65536*4099+796
# CHECK-NEXT: 1001023c: lis 11, 4099
# CHECK-NEXT: lwz 11, 796(11)
# CHECK-NEXT: mtctr 11
# CHECK-NEXT: bctr
## Canonical PLT entry of ifunc.
## 0x10030320 = 65536*4099+800
# CHECK-NEXT: 1001024c: lis 11, 4099
# CHECK-NEXT: lwz 11, 800(11)
# CHECK-NEXT: mtctr 11
# CHECK-NEXT: bctr
## The 3 b instructions are referenced by .plt entries.
# CHECK-NEXT: 1001025c: b 0x10010268
# CHECK-NEXT: b 0x10010268
# CHECK-NEXT: b 0x10010268
## PLTresolve of 64 bytes is at the end.
## Operands of addis & addi: -0x1001025c = 65536*-4097-604
# CHECK-NEXT: lis 12, 0
# CHECK-NEXT: addis 11, 11, -4097
# CHECK-NEXT: lwz 0, 4(12)
# CHECK-NEXT: addi 11, 11, -604
# CHECK-NEXT: mtctr 0
# CHECK-NEXT: add 0, 11, 11
# CHECK-NEXT: lwz 12, 8(12)
# CHECK-NEXT: add 11, 0, 11
# CHECK-NEXT: bctr
# CHECK-COUNT-7: nop
.globl _start
_start:
b func
lis 3, func2@ha
la 3, func2@l(3)
lis 3, func@ha
la 3, func@l(3)
lis 4, ifunc@ha
la 4, ifunc@l(4)