Files
TheRock/compiler/amd-llvm/llvm/test/MC/ELF/relocation-alias.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

68 lines
2.1 KiB
ArmAsm

# RUN: llvm-mc -filetype=obj -triple x86_64 %s -o %t
# RUN: llvm-objdump --no-print-imm-hex -dr %t | FileCheck %s
# RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYM
# RUN: not llvm-mc -filetype=obj -triple x86_64 --defsym ERR0=1 %s -o %t 2>&1 | FileCheck %s --check-prefix=ERR0 --implicit-check-not=error:
# RUN: not llvm-mc -filetype=obj -triple x86_64 --defsym ERR=1 %s -o %t 2>&1 | FileCheck %s --check-prefix=ERR
## If a fixup symbol is equated to an undefined symbol, convert the fixup
## to be against the target symbol, even if there is a variant (@PLT).
# CHECK: callq {{.*}}
# CHECK-NEXT: R_X86_64_PLT32 __GI_memcpy-0x4
# CHECK: movabsq $0, %rax
# CHECK-NEXT: R_X86_64_64 __GI_memcpy+0x2
memcpy = __GI_memcpy
call memcpy@PLT
movabsq $memcpy+2, %rax
# CHECK: movq (%rip), %rax
# CHECK-NEXT: R_X86_64_REX_GOTPCRELX abs-0x4
# CHECK: movq (%rip), %r16
# CHECK-NEXT: R_X86_64_CODE_4_GOTPCRELX abs-0x4
movq abs@GOTPCREL(%rip), %rax
movq abs@GOTPCREL(%rip), %r16
abs = 42
# CHECK: movabsq $0, %rbx
# CHECK-NEXT: R_X86_64_64 data_alias
.globl data_alias
.set data_alias, data
movabsq $data_alias, %rbx
## A local alias to a defined symbol still references a section symbol.
# CHECK: movabsq $0, %rbx
# CHECK-NEXT: R_X86_64_64 .data+0x1
.set data_alias_l, data
movabsq $data_alias_l, %rbx
.data
.byte 0
.globl data
data:
.ifdef ERR0
# ERR0: {{.*}}.s:[[#@LINE+1]]:15: error: relocation specifier not permitted in symbol equating
memcpy_spec = __GI_memcpy@PLT
## Should be rejected as well
memcpy_spec1 = __GI_memcpy@PLT+1
.endif
.ifdef ERR
.text
## Note, GNU as emits a relocation for this erroneous fixup.
# ERR: {{.*}}.s:[[#@LINE+2]]:6: error: expected relocatable expression
memcpy_plus_1 = __GI_memcpy+1
call memcpy_plus_1@PLT
.endif
## Redirected symbols do not have a symbol table entry.
# SYM: NOTYPE LOCAL DEFAULT UND
# SYM-NEXT: NOTYPE LOCAL DEFAULT ABS abs
# SYM-NEXT: NOTYPE LOCAL DEFAULT 4 data_alias_l
# SYM-NEXT: SECTION LOCAL DEFAULT 4 .data
# SYM-NEXT: NOTYPE GLOBAL DEFAULT UND __GI_memcpy
# SYM-NEXT: NOTYPE GLOBAL DEFAULT 4 data_alias
# SYM-NEXT: NOTYPE GLOBAL DEFAULT 4 data
# SYM-NOT: {{.}}