Files
TheRock/compiler/amd-llvm/lld/test/ELF/emit-relocs-synthetic.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

55 lines
1.6 KiB
ArmAsm

# REQUIRES: x86
## Regression test: add STT_SECTION even if synthetic sections are interleaved
## with regular input sections.
# RUN: rm -rf %t && split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o
# RUN: ld.lld --emit-relocs --no-relax -T %t/1.t %t/a.o -o %t/a1
# RUN: llvm-objdump --no-print-imm-hex -dr %t/a1 | FileCheck %s --check-prefixes=CHECK,CHECK1
# RUN: ld.lld --emit-relocs --no-relax -T %t/2.t %t/a.o -o %t/a2
# RUN: llvm-objdump --no-print-imm-hex -dr %t/a2 | FileCheck %s --check-prefixes=CHECK,CHECK2
# CHECK: <_start>:
## %t/a1: bss is at offset 17. bss-4 = .bss + 0xd
## %t/a2: bss is at offset 16. bss-4 = .bss + 0xc
# CHECK-NEXT: movl [[#]](%rip), %eax
# CHECK1-NEXT: R_X86_64_PC32 .bss+0xd
# CHECK2-NEXT: R_X86_64_PC32 .bss+0xc
# CHECK-NEXT: movl [[#]](%rip), %eax
# CHECK-NEXT: R_X86_64_PC32 common-0x4
# CHECK-NEXT: movl [[#]](%rip), %eax
## %t/a1: input .data is at offset 8. 8-4 = 0x4
## %t/a2: input .data is at offset 0. 0-4 = -0x4
# CHECK1-NEXT: R_X86_64_GOTPCRELX .data+0x4
# CHECK2-NEXT: R_X86_64_GOTPCRELX .data-0x4
#--- a.s
.globl _start
_start:
movl bss(%rip), %eax
movl common(%rip), %eax
## Compilers don't produce this. We just check the behavior.
movl .data@gotpcrel(%rip), %eax
.section .data,"aw",@progbits
.quad 0
.section .bss,"aw",@nobits
.space 16
bss:
.byte 0
.comm common,1,1
#--- 1.t
SECTIONS {
.data : { *(.got) *(.data) }
.bss : { *(COMMON) *(.bss) }
}
#--- 2.t
SECTIONS {
.data : { *(.data) *(.got) }
.bss : { *(.bss) *(COMMON) }
}