Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-objcopy/ELF/many-sections.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

103 lines
3.4 KiB
Plaintext

## Show that llvm-objcopy can handle an input file with many sections.
RUN: %python %p/../Inputs/ungzip.py %p/Inputs/many-sections.o.gz > %t
RUN: llvm-objcopy %t %t2
RUN: llvm-readobj --file-headers --sections --symbols %t2 | FileCheck %s
RUN: llvm-readelf --symbols %t2 | FileCheck --check-prefix=SYMS %s
## The ELF header should have e_shnum == 0 and e_shstrndx == SHN_XINDEX.
# CHECK: SectionHeaderCount: 0
# CHECK-NEXT: StringTableSectionIndex: 65535
## The first section header should store the real section header count and
## shstrndx in its fields.
# CHECK: Section {
# CHECK-NEXT: Index: 0
# CHECK-NEXT: Name:
# CHECK-NEXT: Type: SHT_NULL
# CHECK-NEXT: Flags [
# CHECK-NEXT: ]
# CHECK-NEXT: Address:
# CHECK-NEXT: Offset:
# CHECK-NEXT: Size: [[#SHNUM:]]
# CHECK-NEXT: Link: [[#SHNUM-1]]
## Show that the .symtab_shndx section has the correct properties.
## To avoid accidentally capturing the index of an unrelated section header for
## checking the sh_link of the .symtab_shndx section, use the index of the
## section immediately following the symbol table.
# CHECK: Name: .symtab
# CHECK-NEXT: Type: SHT_SYMTAB
# CHECK: Index: [[#AFTERSYMTAB:]]
# CHECK: Name: .symtab_shndx
# CHECK-NEXT: Type: SHT_SYMTAB_SHNDX
# CHECK-NEXT: Flags [ (0x0)
# CHECK-NEXT: ]
# CHECK-NEXT: Address: 0x0
# CHECK-NEXT: Offset:
## There should be #syms * EntrySize bytes.
# CHECK-NEXT: Size: 262148
# CHECK-NEXT: Link: [[#AFTERSYMTAB-1]]
# CHECK-NEXT: Info: 0
# CHECK-NEXT: AddressAlignment: 4
# CHECK-NEXT: EntrySize: 4
## Show that the sh_link of the first section header is the section header table
## index. Also show that the last section is the .strtab.
# CHECK: Index: [[#SHNUM-1]]
# CHECK-NEXT: Name: .strtab
## Show that the symbols with section indexes around the reserved range still
## have the right section indexes afterwards.
# CHECK: Section: s65279 (0xFEFF)
# CHECK-NEXT: }
## st_shndx == SHN_LORSERVE.
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: sym65280 (
# CHECK-NEXT: Value: 0x0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Local (0x0)
# CHECK-NEXT: Type: None (0x0)
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: s65280 (0xFF00)
# CHECK-NEXT: }
## st_shndx == SHN_ABS.
# CHECK: Name: sym65521 (
# CHECK-NEXT: Value: 0x0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Local (0x0)
# CHECK-NEXT: Type: None (0x0)
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: s65521 (0xFFF1)
# CHECK-NEXT: }
## st_shndx == SHN_COMMON.
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: sym65522 (
# CHECK-NEXT: Value: 0x0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Local (0x0)
# CHECK-NEXT: Type: None (0x0)
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: s65522 (0xFFF2)
# CHECK-NEXT: }
## st_shndx == SHN_XINDEX.
# CHECK: Name: sym65535 (
# CHECK-NEXT: Value: 0x0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Local (0x0)
# CHECK-NEXT: Type: None (0x0)
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: s65535 (0xFFFF)
# CHECK-NEXT: }
## st_shndx > SHN_XINDEX.
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: sym65536 (
# CHECK-NEXT: Value: 0x0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Local (0x0)
# CHECK-NEXT: Type: None (0x0)
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: s65536 (0x10000)
# CHECK-NEXT: }
# SYMS: Symbol table '.symtab' contains 65537 entries