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
101 lines
2.3 KiB
ArmAsm
101 lines
2.3 KiB
ArmAsm
## Check that BOLT symbolizer properly handles loads from GOT, including
|
|
## instruction sequences changed/relaxed by the linker.
|
|
|
|
# RUN: split-file %s %t
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %t/main.s \
|
|
# RUN: -o %t/main.o
|
|
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %t/near.s \
|
|
# RUN: -o %t/near.o
|
|
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %t/far.s \
|
|
# RUN: -o %t/far.o
|
|
# RUN: %clang %cflags %t/main.o %t/near.o %t/far.o -o %t/main.exe -Wl,-q -static
|
|
# RUN: llvm-bolt %t/main.exe -o %t/main.bolt --keep-nops --print-disasm \
|
|
# RUN: --print-only=_start | FileCheck %s
|
|
|
|
#--- main.s
|
|
|
|
.text
|
|
.globl _start
|
|
.p2align 2
|
|
.type _start, @function
|
|
# CHECK-LABEL: _start
|
|
_start:
|
|
|
|
## Function address load relaxable into nop+adr.
|
|
# CHECK: nop
|
|
# CHECK-NEXT: adr x0, near
|
|
adrp x0, :got:near
|
|
ldr x0, [x0, :got_lo12:near]
|
|
|
|
## Function address load relaxable into adrp+add.
|
|
# CHECK-NEXT: adrp x1, far
|
|
# CHECK-NEXT: add x1, x1, :lo12:far
|
|
adrp x1, :got:far
|
|
ldr x1, [x1, :got_lo12:far]
|
|
|
|
## Non-relaxable due to the instruction in-between.
|
|
# CHECK-NEXT: adrp x2, __BOLT_got_zero
|
|
# CHECK-NEXT: nop
|
|
# CHECK-NEXT: ldr x2, [x2, :lo12:__BOLT_got_zero{{.*}}]
|
|
adrp x2, :got:near
|
|
nop
|
|
ldr x2, [x2, :got_lo12:near]
|
|
|
|
## Load data object with local visibility. Relaxable into adrp+add.
|
|
# CHECK-NEXT: adrp x3, "local_far_data/1"
|
|
# CHECK-NEXT: add x3, x3, :lo12:"local_far_data/1"
|
|
adrp x3, :got:local_far_data
|
|
ldr x3, [x3, :got_lo12:local_far_data]
|
|
|
|
## Global data reference relaxable into adrp+add.
|
|
# CHECK-NEXT: adrp x4, far_data
|
|
# CHECK-NEXT: add x4, x4, :lo12:far_data
|
|
adrp x4, :got:far_data
|
|
ldr x4, [x4, :got_lo12:far_data]
|
|
|
|
ret
|
|
.size _start, .-_start
|
|
|
|
.weak near
|
|
.weak far
|
|
.weak far_data
|
|
|
|
## Data object separated by more than 1MB from _start.
|
|
.data
|
|
.type local_far_data, @object
|
|
local_far_data:
|
|
.xword 0
|
|
.size local_far_data, .-local_far_data
|
|
|
|
#--- near.s
|
|
|
|
.text
|
|
.globl near
|
|
.type near, @function
|
|
near:
|
|
ret
|
|
.size near, .-near
|
|
|
|
#--- far.s
|
|
|
|
.text
|
|
|
|
## Insert 1MB of empty space to make objects after it unreachable by adr
|
|
## instructions in _start.
|
|
.space 0x100000
|
|
|
|
.globl far
|
|
.type far, @function
|
|
far:
|
|
ret
|
|
.size far, .-far
|
|
|
|
.data
|
|
.globl far_data
|
|
.type far_data, @object
|
|
far_data:
|
|
.xword 0
|
|
.size far_data, .-far_data
|
|
|