[PATCH] D129507: [llvm-objcopy] Add option to dump embedded offloading images

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 12:47:21 PDT 2022


tra added a comment.

In D129507#3643246 <https://reviews.llvm.org/D129507#3643246>, @MaskRay wrote:

> The feature doesn't fit into llvm-objcopy's purpose. llvm-objcopy is a binary manipulation tool which only understands ELF. `--dump-offloading` seems to parse the content using knowledge of the underlying format.

Which tool would be appropriate for something like this? Do you suggest that we need a new tool?

The "only understands ELF" part may be open to interpretation. If one were to implement an extension to ELF format, would objcopy be the right place to support it? While `objdump` does have knowledge of the underlying formats, it does not deal with extraction of such data, but rather interprets it for human consumption.
This use case is somewhere in between -- it involves binary data manipulation, which is what objcopy does, but it does require some knowledge of the underlying format.

IMO, the offloading packing format is closer to being an extension of ELF, than being yet another ISA to disassemble (i.e. it's simple, generic and unlikely to change much) and objcopy seems like a decent fit. Offloading data manipulation may eventually be extended to insert new offload binaries, too, which would also fit objcopy functionality nicely.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129507/new/

https://reviews.llvm.org/D129507



More information about the llvm-commits mailing list