Files
TheRock/compiler/amd-llvm/bolt/test/AArch64/plt-mold-func-symbols.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

37 lines
1.2 KiB
ArmAsm

## Test that BOLT correctly handles mold-style STT_FUNC symbols in PLT
## sections.
# REQUIRES: system-linux
## Build a shared library from the common stubs.
# RUN: %clang %cflags %p/../Inputs/stub.c -fPIC -shared -o %t.so
## Build and link the main binary. The linker creates a real PLT entry.
# RUN: llvm-mc -filetype=obj -triple aarch64-linux %s -o %t.o
# RUN: ld.lld -pie %t.o %t.so -o %t.exe --emit-relocs
## Inject a mold-style STT_FUNC symbol at the PLT entry for printf.
## Mold places "printf$plt" directly on the PLT stub; we simulate this
## with llvm-objcopy. The PLT header is 32 bytes on AArch64, and each
## entry is 16 bytes. printf is the only entry after the header.
# RUN: llvm-objcopy --add-symbol "printf\$plt=.plt:32,function,local" \
# RUN: %t.exe %t
## Verify BOLT resolves the call as printf@PLT, not printf$plt.
# RUN: llvm-bolt %t -o %t.bolt --print-cfg --print-only=_start 2>&1 \
# RUN: | FileCheck %s
# RUN: llvm-readobj --syms %t.bolt | grep -A7 printf$plt | FileCheck \
# RUN: %s --check-prefix=CHECK-SYM
# CHECK: bl printf@PLT
# CHECK-NOT: printf$plt
# CHECK-SYM: Section: .plt
.text
.globl _start
.type _start, %function
_start:
bl printf
ret
.size _start, .-_start