Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-objcopy/ELF/add-invalid-note.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

55 lines
3.0 KiB
Plaintext

## Verify that --add-section warns on invalid note sections.
## Add [namesz, descsz, type, name, desc] for a build id.
## Notes should be padded to 8 bytes.
# RUN: printf "\004\000\000\000" > %t-miss-padding-note.bin
# RUN: printf "\007\000\000\000" >> %t-miss-padding-note.bin
# RUN: printf "\003\000\000\000" >> %t-miss-padding-note.bin
# RUN: printf "GNU\000" >> %t-miss-padding-note.bin
# RUN: printf "\014\015\016" >> %t-miss-padding-note.bin
## The namesz field bit is incorrect.
# RUN: printf "\010\000\000\000" > %t-invalid-size-note.bin
# RUN: printf "\007\000\000\000" >> %t-invalid-size-note.bin
# RUN: printf "\003\000\000\000" >> %t-invalid-size-note.bin
# RUN: printf "GNU\000" >> %t-invalid-size-note.bin
# RUN: printf "\014\015\016\000" >> %t-invalid-size-note.bin
## Missing type field.
# RUN: printf "\010\000\000\000" > %t-short-note.bin
# RUN: printf "\007\000\000\000" >> %t-short-note.bin
# RUN: yaml2obj %s -o %t.o
## Test each invalid note.
# RUN: not llvm-objcopy --add-section=.note.miss.padding=%t-miss-padding-note.bin %t.o %t-with-note.o 2>&1 | FileCheck --check-prefix=CHECK-MISS-PADDING %s
# CHECK-MISS-PADDING: .note.miss.padding data size must be a multiple of 4 bytes
# RUN: not llvm-objcopy --add-section=.note.invalid.size=%t-invalid-size-note.bin %t.o %t-with-note.o 2>&1 | FileCheck --check-prefix=CHECK-INVALID-SIZE %s
# CHECK-INVALID-SIZE: .note.invalid.size data size is incompatible with the content of the name and description size fields: expecting 28, found 20
# RUN: not llvm-objcopy --add-section=.note.short=%t-short-note.bin %t.o %t-with-note.o 2>&1 | FileCheck --check-prefix=CHECK-SHORT %s
# CHECK-SHORT: .note.short data must be either empty or at least 12 bytes long
## Test compatibility with .note.gnu.property, which has 8-byte alignment.
# RUN: printf "\004\000\000\000\100\000\000\000\005\000\000\000\107\116\125\000" > %t-note-gnu-property.bin
# RUN: printf "\002\000\000\300\004\000\000\000\003\000\000\000\000\000\000\000" >> %t-note-gnu-property.bin
# RUN: printf "\001\200\001\300\004\000\000\000\001\000\000\000\000\000\000\000" >> %t-note-gnu-property.bin
# RUN: printf "\001\000\001\300\004\000\000\000\013\000\000\000\000\000\000\000" >> %t-note-gnu-property.bin
# RUN: printf "\002\000\001\300\004\000\000\000\001\000\000\000\000\000\000\000" >> %t-note-gnu-property.bin
# RUN: llvm-objcopy --add-section=.note.gnu.property=%t-note-gnu-property.bin %t.o %t-with-note-gnu-property.o
## Test that verification can be disabled.
# RUN: llvm-objcopy --add-section=.note.short=%t-short-note.bin --no-verify-note-sections %t.o %t-with-note.o
## Test that last argument has precedence.
# RUN: llvm-objcopy --add-section=.note.short=%t-short-note.bin --verify-note-sections --no-verify-note-sections %t.o %t-with-note.o
# RUN: not llvm-objcopy --add-section=.note.short=%t-short-note.bin --no-verify-note-sections --verify-note-sections %t.o %t-with-note.o 2>&1 | FileCheck --check-prefix=CHECK-SHORT %s
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL