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

98 lines
5.1 KiB
Plaintext

# RUN: yaml2obj %s -o %t
# RUN: llvm-objcopy --change-section-lma *+0x20 %t %t2
# RUN: llvm-readelf --program-headers %t2 | FileCheck %s --check-prefix=CHECK-PLUS-PROGRAMS
# RUN: llvm-readelf --section-headers %t2 | FileCheck %s --check-prefix=CHECK-PLUS-SECTIONS
# RUN: llvm-objcopy --change-section-lma *-0x30 %t %t3
# RUN: llvm-readelf --program-headers %t3 | FileCheck %s --check-prefix=CHECK-MINUS-PROGRAMS
# RUN: llvm-readelf --section-headers %t3 | FileCheck %s --check-prefix=CHECK-MINUS-SECTIONS
# RUN: not llvm-objcopy --change-section-lma .text3=0x5000 %t 2>&1 | FileCheck %s --check-prefix=ERR-SET-ADDRESS
# RUN: not llvm-objcopy --change-section-lma .text3+0x30 %t 2>&1 | FileCheck %s --check-prefix=ERR-SPECIFIC-SEC
# RUN: not llvm-objcopy --change-section-lma *+0c50 %t 2>&1 | FileCheck %s --check-prefix=ERR-INVALID-VAL
# RUN: not llvm-objcopy --change-section-lma 0 %t 2>&1 | FileCheck %s --check-prefix=ERR-MISSING-OFFSET
# RUN: not llvm-objcopy --change-section-lma *-0x2000 %t 2>&1 | FileCheck %s --check-prefix=ERR-UNDERFLOW
# RUN: not llvm-objcopy --change-section-lma *+0x100000000 %t 2>&1 | FileCheck %s --check-prefix=ERR-OVERFLOW
# CHECK-PLUS-PROGRAMS: Type Offset VirtAddr PhysAddr FileSiz MemSiz
# CHECK-PLUS-PROGRAMS: PHDR 0x000002 0x0000000000001102 0x0000000000001122 0x000038 0x000038
# CHECK-PLUS-PROGRAMS: LOAD 0x000000 0x0000000000001100 0x0000000000001120 0x0002c8 0x0002c8
# CHECK-PLUS-PROGRAMS: LOAD 0x0002c8 0xffffffff00005100 0xffffffff00006120 0x000100 0x000100
# CHECK-PLUS-PROGRAMS: NOTE 0x000358 0x0000000000001200 0x0000000000001220 0x000010 0x000010
# CHECK-PLUS-PROGRAMS: NOTE 0x000368 0x0000000000000000 0x0000000000000000 0x000000 0x000000
# CHECK-PLUS-PROGRAMS: LOAD 0x0003c8 0x0000000000001300 0x0000000000001320 0x000000 0x000010
# CHECK-PLUS-PROGRAMS: NOTE 0x000378 0x0000000000000000 0x0000000000000000 0x000010 0x000000
# CHECK-MINUS-PROGRAMS: PHDR 0x000002 0x0000000000001102 0x00000000000010d2 0x000038 0x000038
# CHECK-MINUS-PROGRAMS: LOAD 0x000000 0x0000000000001100 0x00000000000010d0 0x0002c8 0x0002c8
# CHECK-MINUS-PROGRAMS: LOAD 0x0002c8 0xffffffff00005100 0xffffffff000060d0 0x000100 0x000100
# CHECK-MINUS-PROGRAMS: NOTE 0x000358 0x0000000000001200 0x00000000000011d0 0x000010 0x000010
# CHECK-MINUS-PROGRAMS: NOTE 0x000368 0x0000000000000000 0x0000000000000000 0x000000 0x000000
# CHECK-MINUS-PROGRAMS: LOAD 0x0003c8 0x0000000000001300 0x00000000000012d0 0x000000 0x000010
# CHECK-MINUS-PROGRAMS: NOTE 0x000378 0x0000000000000000 0x0000000000000000 0x000010 0x000000
# CHECK-PLUS-SECTIONS: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
# CHECK-PLUS-SECTIONS: .text1
# CHECK-PLUS-SECTIONS-SAME: 0000000000000000
# CHECK-PLUS-SECTIONS: .text2
# CHECK-PLUS-SECTIONS-SAME: 0000000000000000
# CHECK-MINUS-SECTIONS: .text1
# CHECK-MINUS-SECTIONS-SAME: 0000000000000000
# CHECK-MINUS-SECTIONS: .text2
# CHECK-MINUS-SECTIONS-SAME: 0000000000000000
# ERR-SET-ADDRESS: error: bad format for --change-section-lma: changing LMA to a specific value is not supported. Use *+val or *-val instead
# ERR-SPECIFIC-SEC: error: bad format for --change-section-lma: changing a specific section LMA is not supported. Use *+val or *-val instead
# ERR-INVALID-VAL: error: bad format for --change-section-lma: value after *+ is 0c50 when it should be an integer
# ERR-MISSING-OFFSET: error: bad format for --change-section-lma: missing LMA offset
# ERR-UNDERFLOW: : address 0x1102 cannot be decreased by 0x2000. The result would underflow
# ERR-OVERFLOW: address 0xffffffff00006100 cannot be increased by 0x100000000. The result would overflow
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Sections:
- Name: .text1
Type: SHT_PROGBITS
Size: 0x100
- Name: .text2
Type: SHT_PROGBITS
Size: 0x100
- Name: .bss1
Type: SHT_NOBITS
Size: 0x10
ProgramHeaders:
- Type: PT_PHDR
FileSize: 0x38
MemSize: 0x38
Offset: 0x2
VAddr: 0x1102
- Type: PT_LOAD
Offset: 0x0
VAddr: 0x1100
FirstSec: .text1
LastSec: .text1
- Type: PT_LOAD
VAddr: 0xFFFFFFFF00005100
PAddr: 0xFFFFFFFF00006100
FirstSec: .text2
LastSec: .text2
- Type: PT_NOTE
FileSize: 0x10
MemSize: 0x10
VAddr: 0x1200
Offset: 0x358
- Type: PT_NOTE
FileSize: 0x0
MemSize: 0x0
Offset: 0x368
- Type: PT_LOAD
VAddr: 0x1300
FirstSec: .bss1
LastSec: .bss1
- Type: PT_NOTE
FileSize: 0x10
MemSize: 0x0
Offset: 0x378