[llvm-objdump] Add support for dumping embedded offloading dataIn Clang/LLVM we are moving towards a new binary format to store manyembedded object files to create a fatbinary. This patch adds sup
[llvm-objdump] Add support for dumping embedded offloading dataIn Clang/LLVM we are moving towards a new binary format to store manyembedded object files to create a fatbinary. This patch adds support fordumping these embedded images in the `llvm-objdump` tool. This willallow users to query information about what is stored inside the binary.This has very similar functionality to the `cuobjdump` tool for thoe familiarwith the Nvidia utilities. The proposed use is as follows:```$ clang input.c -fopenmp --offload-arch=sm_70 --offload-arch=sm_52 -c$ llvm-objdump -O input.oinput.o: file format elf64-x86-64OFFLOADIND IMAGE [0]:kind cubinarch sm_52triple nvptx64-nvidia-cudaproducer openmpOFFLOADIND IMAGE [1]:kind cubinarch sm_70triple nvptx64-nvidia-cudaproducer openmp```This will be expanded further once we start embedding more informationinto these offloading images. Right now we are planning on addingflags and entries for debug level, optimization, LTO usage, targetfeatures, among others.This patch only supports printing these sections, later we will want tosupport dumping files the user may be interested in via another flag. Iam unsure if this should go here in `llvm-objdump` or `llvm-objcopy`.Reviewed By: MaskRay, tra, jhenderson, JonChesterfieldDifferential Revision: https://reviews.llvm.org/D126904
show more ...