[llvm] [DirectX] Add `extract-section` to `llvm-objcopy` and implement it for `DXContainer` (PR #154804)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 02:14:12 PDT 2025


================
@@ -79,6 +79,18 @@ multiple file formats.
  Enable deterministic mode when copying archives, i.e. use 0 for archive member
  header UIDs, GIDs and timestamp fields. On by default.
 
+.. option:: --extract-section <section>=<file>
+
+ Extract the specified section ``<section>`` into the file ``<file>`` as a
+ seperate object. Can be specified multiple times to extract multiple sections.
+ ``<file>`` is unrelated to the input and output files provided to
+ :program:`llvm-objcopy` and as such the normal copying and editing
+ operations will still be performed. No operations are performed on the sections
+ prior to dumping them.
+
+ For MachO objects, ``<section>`` must be formatted as
+ ``<segment name>,<section name>``.
----------------
jh7370 wrote:

This bit of the comment seems redundant, since the option isn't supported for Mach-O?

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


More information about the llvm-commits mailing list