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

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 06:49:59 PDT 2022


jhuber6 added a comment.

In D129507#3647420 <https://reviews.llvm.org/D129507#3647420>, @jhenderson wrote:

> I'm not familiar with some of the mentioned tools, but I tend to agree with @MaskRay's conclusions.
>
> 1. The functionality doesn't really fit in llvm-objcopy because the tool is intended for modifying a file in-place or making a (modified) copy to another place, neither of which is what you'll actually want it for. I think it //would// be appropriate for extracting the offloading section from an ELF binary as a whole, since that would basically just be --dump-section. Ideally, we'd have the ability to extract by section type, not just section name, but that's getting out-of-scope for this discussion.
>
> 2. llvm-objdump shouldn't be writing things to a file (or producing "binary" output that is intended for piping directly to a file). It's goal is printing information about object files. It is appropriate for it to be able to dump the offloading sections in an interpreted format, but not to extract them.
>
> That means the functionality needs adding to a different tool, I feel (whether that tool is a new one or an existing one, I don't know).

`llvm-objdump` has the `-s -j <secname>` functionality, but that just dumps straight to the screen in hex format. I could put this in the `clang-offload-packger`, the tools that makes these blobs in the first place, but since it's a `clang` tool and doesn't care about object files I figured it wouldn't be a good fit. But if people are opposed to this kind of functionality in `llvm-objdump`, `llvm-readobj`, or `llvm-objcopy` I can just put it in there so it's at least available.


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