Files
TheRock/compiler/amd-llvm/lld/test/ELF/mips-jalr-non-functions.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

59 lines
1.9 KiB
ArmAsm

# REQUIRES: mips
## Check that we ignore R_MIPS_JALR relocations agains non-function symbols.
## Older versions of clang were erroneously generating them for function pointers
## loaded from any table (not just the GOT) as well as against TLS function
## pointers (when using the local-dynamic model), so we need to ignore these
## relocations to avoid generating binaries that crash when executed.
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
## Link in another object file with a .bss as a regression test:
## Previously LLD asserted when skipping over .bss sections when determining the
## location for a warning/error message. By adding another file with a .bss
## section before the actual %t.o we can reproduce this case.
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %S/Inputs/common.s -o %t-common.o
# RUN: ld.lld -shared %t-common.o %t.o -o %t.so 2>&1 | FileCheck %s -check-prefix WARNING-MESSAGE
# RUN: llvm-objdump --no-show-raw-insn --no-leading-addr -d %t.so | FileCheck %s
.set noreorder
test:
.reloc .Ltmp1, R_MIPS_JALR, tls_obj
.Ltmp1:
jr $t9
nop
# WARNING-MESSAGE: warning: {{.+}}.tmp.o:(.text+0x0): found R_MIPS_JALR relocation against non-function symbol tls_obj. This is invalid and most likely a compiler bug.
.reloc .Ltmp2, R_MIPS_JALR, reg_obj
.Ltmp2:
jr $t9
nop
# WARNING-MESSAGE: warning: {{.+}}.tmp.o:(.text+0x8): found R_MIPS_JALR relocation against non-function symbol reg_obj. This is invalid and most likely a compiler bug.
.reloc .Ltmp3, R_MIPS_JALR, untyped
.Ltmp3:
jr $t9
nop
## However, we do perform the optimization for untyped symbols:
untyped:
nop
.type tls_obj,@object
.section .tbss,"awT",@nobits
tls_obj:
.word 0
.type reg_obj,@object
.data
reg_obj:
.word 0
# CHECK-LABEL: Disassembly of section .text:
# CHECK-EMPTY:
# CHECK-NEXT: <test>:
# CHECK-NEXT: jr $25
# CHECK-NEXT: nop
# CHECK-NEXT: jr $25
# CHECK-NEXT: nop
# CHECK-NEXT: b {{.*}} <untyped>
# CHECK-NEXT: nop