Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-objcopy/ELF/set-section-alignment.test
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

63 lines
2.1 KiB
Plaintext

# RUN: yaml2obj %s -o %t
# RUN: llvm-objcopy --set-section-alignment .foo=4 --set-section-alignment .bar=0x5 \
# RUN: --set-section-alignment .baz=0 %t %t.2
# RUN: llvm-readobj --sections %t.2 | FileCheck --check-prefix=CHECK %s
# CHECK: Name: .foo
# CHECK: AddressAlignment:
# CHECK-SAME: 4{{$}}
# CHECK: Name: .bar
# CHECK: AddressAlignment:
# CHECK-SAME: 5{{$}}
# CHECK: Name: .baz
# CHECK: AddressAlignment:
# CHECK-SAME: 0{{$}}
## If a section is specified multiple times, the last wins.
## Also incidentally show that unmentioned sections are not impacted.
# RUN: llvm-objcopy --set-section-alignment .foo=4 --set-section-alignment=.foo=7 %t %t.3
# RUN: llvm-readobj --sections %t.3 | FileCheck --check-prefix=MULTI %s
# MULTI: Name: .foo
# MULTI: AddressAlignment:
# MULTI-SAME: 7{{$}}
# MULTI: Name: .bar
# MULTI: AddressAlignment:
# MULTI-SAME: 0{{$}}
# MULTI: Name: .baz
# MULTI: AddressAlignment:
# MULTI-SAME: 4{{$}}
## Ignore the option if the section does not exist.
# RUN: llvm-objcopy --set-section-alignment .not_exist=4 %t.3 %t.4
# RUN: cmp %t.3 %t.4
# RUN: not llvm-objcopy --set-section-alignment=.foo %t /dev/null 2>&1 | \
# RUN: FileCheck --check-prefix=MISSING-EQUAL %s
# MISSING-EQUAL: error: bad format for --set-section-alignment: missing '='
# RUN: not llvm-objcopy --set-section-alignment==4 %t /dev/null 2>&1 | \
# RUN: FileCheck --check-prefix=MISSING-SECTION %s
# MISSING-SECTION: error: bad format for --set-section-alignment: missing section name
# RUN: not llvm-objcopy --set-section-alignment=.foo=bar %t /dev/null 2>&1 | \
# RUN: FileCheck --check-prefix=INVALID-ALIGN %s
# INVALID-ALIGN: error: invalid value for --set-section-alignment: 'bar'
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .foo
Type: SHT_PROGBITS
- Name: .bar
Type: SHT_NOBITS
- Name: .baz
Type: SHT_NOTE
AddressAlign: 4
Notes: []