Files
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

147 lines
4.8 KiB
YAML

## Check how obj2yaml produces SHT_GNU_HASH section descriptions.
## Check that obj2yaml uses "Header", "BloomFilter", "HashBuckets" and "HashValues"
## tags to describe a SHT_GNU_HASH section when it has content of a correct size.
# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: obj2yaml %t1 | FileCheck %s --check-prefix=FIELDS
# FIELDS: - Name: .gnu.hash
# FIELDS-NEXT: Type: SHT_GNU_HASH
# FIELDS-NEXT: Flags: [ SHF_ALLOC ]
# FIELDS-NEXT: Header:
# FIELDS-NEXT: SymNdx: 0x1
# FIELDS-NEXT: Shift2: 0x2
# FIELDS-NEXT: BloomFilter: [ 0x3, 0x4 ]
# FIELDS-NEXT: HashBuckets: [ 0x5, 0x6, 0x7 ]
# FIELDS-NEXT: HashValues: [ 0x8, 0x9, 0xA, 0xB ]
--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_DYN
Sections:
- Name: .gnu.hash
Type: SHT_GNU_HASH
Flags: [ SHF_ALLOC ]
Header:
SymNdx: 0x1
Shift2: 0x2
BloomFilter: [0x3, 0x4]
HashBuckets: [0x5, 0x6, 0x7]
HashValues: [0x8, 0x9, 0xA, 0xB]
## Check how we handle broken cases.
# RUN: yaml2obj --docnum=2 %s -o %t2
# RUN: obj2yaml %t2 | FileCheck %s --check-prefix=INVALID
# INVALID: - Name: .gnu.hash.tooshort
# INVALID-NEXT: Type: SHT_GNU_HASH
# INVALID-NEXT: Flags: [ SHF_ALLOC ]
# INVALID-NEXT: Content: 112233445566778899AABBCCDDEEFF
# INVALID-NEXT: - Name: .gnu.hash.empty
# INVALID-NEXT: Type: SHT_GNU_HASH
# INVALID-NEXT: Flags: [ SHF_ALLOC ]
# INVALID-NEXT: Address: 0xF
# INVALID-NEXT: Header:
# INVALID-NEXT: SymNdx: 0x0
# INVALID-NEXT: Shift2: 0x0
# INVALID-NEXT: BloomFilter: [ ]
# INVALID-NEXT: HashBuckets: [ ]
# INVALID-NEXT: HashValues: [ ]
# INVALID-NEXT: - Name: .gnu.hash.broken.maskwords
# INVALID-NEXT: Type: SHT_GNU_HASH
# INVALID-NEXT: Content: '00000000000000000100000000000000'
# INVALID-NEXT: - Name: .gnu.hash.broken.nbuckets.a
# INVALID-NEXT: Type: SHT_GNU_HASH
# INVALID-NEXT: Content: '01000000000000000000000000000000'
# INVALID-NEXT: - Name: .gnu.hash.broken.nbuckets.b
# INVALID-NEXT: Type: SHT_GNU_HASH
# INVALID-NEXT: Content: FFFFFFFF000000000100000000000000{{$}}
# INVALID-NEXT: - Name: .gnu.hash.hashvalues.ok
# INVALID-NEXT: Type: SHT_GNU_HASH
# INVALID-NEXT: Header:
# INVALID-NEXT: SymNdx: 0x0
# INVALID-NEXT: Shift2: 0x0
# INVALID-NEXT: BloomFilter: [ ]
# INVALID-NEXT: HashBuckets: [ ]
# INVALID-NEXT: HashValues: [ 0x0 ]
# INVALID-NEXT: - Name: .gnu.hash.hashvalues.fail
# INVALID-NEXT: Type: SHT_GNU_HASH
# INVALID-NEXT: Content: '000000000000000000000000000000000000000000'
--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_DYN
Sections:
## Case 1: Content is less than 16 bytes.
- Name: .gnu.hash.tooshort
Type: SHT_GNU_HASH
Flags: [ SHF_ALLOC ]
Content: "112233445566778899AABBCCDDEEFF"
## Case2: Check how we handle a fully empty hash section.
## It is almost technically valid, but uncommon. Modern linkers
## create at least one entry in Bloom filter if they want to disable it.
## Also, the dynamic symbol table has a null entry and having SymNdx = 0
## here is at least strange.
- Name: .gnu.hash.empty
Type: SHT_GNU_HASH
Flags: [ SHF_ALLOC ]
Header:
SymNdx: 0x0
Shift2: 0x0
MaskWords: 0x0
NBuckets: 0x0
BloomFilter: []
HashBuckets: []
HashValues: []
## Case 3: MaskWords field is broken: it says that the number of entries
## in the Bloom filter is 1, but the Bloom filter is empty.
- Name: .gnu.hash.broken.maskwords
Type: SHT_GNU_HASH
Header:
SymNdx: 0x0
Shift2: 0x0
MaskWords: 0x1
NBuckets: 0x0
BloomFilter: []
HashBuckets: []
HashValues: []
## Case 4(a): NBuckets field is broken, it says that the number of entries
## in the hash buckets is 1, but it is empty.
- Name: .gnu.hash.broken.nbuckets.a
Type: SHT_GNU_HASH
Header:
SymNdx: 0x0
Shift2: 0x0
MaskWords: 0x0
NBuckets: 0x1
BloomFilter: []
HashBuckets: []
HashValues: []
## Case 4(b): NBuckets = 0xFFFFFFFF is incorrect. The result will cause 32-bit
## unsigned overflows if we keep intermediate expressions uint32_t.
- Name: .gnu.hash.broken.nbuckets.b
Type: SHT_GNU_HASH
Header:
SymNdx: 0x0
Shift2: 0x0
MaskWords: 0x1
NBuckets: 0xFFFFFFFF
BloomFilter: []
HashBuckets: []
HashValues: []
## Case 5: Check that we use the various properties to dump the data when it
## has a size that is a multiple of 4, but fallback to dumping the whole section
## using the "Content" property otherwise.
- Name: .gnu.hash.hashvalues.ok
Type: SHT_GNU_HASH
Content: "0000000000000000000000000000000000000000"
- Name: .gnu.hash.hashvalues.fail
Type: SHT_GNU_HASH
Content: "000000000000000000000000000000000000000000"