[llvm-branch-commits] [llvm] [DirectX] Add `split-section` to `llvm-objcopy` and implement it for `DXContainer` (PR #153265)

Finn Plummer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 15 10:01:56 PDT 2025


inbelic wrote:

> Rather than a new option, I'd rather you just add support for `--only-section` and `--dump-section`, which can then be specified in conjunction with each other to achieve the same result. IIRC, a while back, `--split-dwo` was considered a mistake, because the same effect could be achieved by specifying `--extract-dwo` and `--strip-dwo` and `--split-dwo` doesn't exist in GNU objcopy (which we aim for broad compatibility with).

I assume you mean `--remove-section` and `--dump-section`. The issue for our use-case is that `--dump-section` only outputs the section contents, it does not output a valid object with just one section specified.

It could be that such an option isn't really applicable to other object formats, and we could go about this as a `DXContainer` specific option.

We thought it best not to have a different implementation of `dump-section` for `DXContainer` that outputs more than just the contents.

https://github.com/llvm/llvm-project/pull/153265


More information about the llvm-branch-commits mailing list