This patch is a piece of D99360.
The patch prints ELF notes in SHT/PT_NOTE sections/segments of the ELF offload images. The implementation is based on LLVM ELFObjectFile.
Debug output from the plugins would look like this:
TARGET Common ELF --> LLVMOMPOFFLOAD ELF note NT_LLVM_OPENMP_OFFLOAD_VERSION with value: '1.0'
TARGET Common ELF --> LLVMOMPOFFLOAD ELF note NT_LLVM_OPENMP_OFFLOAD_PRODUCER with value: 'LLVM'
TARGET Common ELF --> LLVMOMPOFFLOAD ELF note NT_LLVM_OPENMP_OFFLOAD_PRODUCER_VERSION with value: '13.0.0git 9f8975163c75b1f9f736f9a8e0a60e29ac062754'
clang-tidy: warning: invalid case style for function 'elf_check_machine' [readability-identifier-naming]
not useful
clang-tidy: warning: invalid case style for parameter 'image' [readability-identifier-naming]
not useful
clang-tidy: warning: invalid case style for parameter 'target_id' [readability-identifier-naming]
not useful