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

James Henderson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 15 00:33:51 PDT 2025


jh7370 wrote:

> @inbelic can confirm, but I thought the intent was for this to work like `--split-dwo` where it also removes the section from the original object.
> 
> We have a few common tooling cases for DX files where the compiler generates an object with a bunch of sections that you may strip out later (debug info, runtime reflection, runtime signatures). What we'd like to have is a tooling path where we can do that with a single invocation of objcopy something like:
> 
> ```
> llvm-objcopy <input object> --split-section=RTS0=<path to new signature> --split-section=STAT=<path to new reflection> --split-section=ILDB=<path to new debug info>
> ```
> 
> I suggested making this a general option since it could be implemented for any object file type, but if you think it is better to do it as a DX-specific option we could do that as well.

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).

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


More information about the llvm-branch-commits mailing list