Skip to content

Commit c975668

Browse files
committed
Fix llvm-strip --only-keep-debug documentation for ELF
The functionality (and llvm-objcopy's corresponding documentation) was added in llvm@5ad0103. It looks like the llvm-strip docs to match were missed. Reviewed by: gbreynoo Differential Revision: https://reviews.llvm.org/D121902
1 parent 920c2e5 commit c975668

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

llvm/docs/CommandGuide/llvm-strip.rst

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ multiple file formats.
5959
Write output to <file>. Multiple input files cannot be used in combination
6060
with -o.
6161

62+
.. option:: --only-keep-debug
63+
64+
Produce a debug file as the output that only preserves contents of sections
65+
useful for debugging purposes.
66+
67+
For ELF objects, this removes the contents of `SHF_ALLOC` sections that are not
68+
`SHT_NOTE` by making them `SHT_NOBITS` and shrinking the program headers where
69+
possible.
70+
6271
.. option:: --regex
6372

6473
If specified, symbol and section names specified by other switches are treated
@@ -129,18 +138,6 @@ multiple file formats.
129138

130139
Read command-line options and commands from response file `<FILE>`.
131140

132-
COFF-SPECIFIC OPTIONS
133-
---------------------
134-
135-
The following options are implemented only for COFF objects. If used with other
136-
objects, :program:`llvm-strip` will either emit an error or silently ignore
137-
them.
138-
139-
.. option:: --only-keep-debug
140-
141-
Remove the contents of non-debug sections from the output, but keep the section
142-
headers.
143-
144141
ELF-SPECIFIC OPTIONS
145142
--------------------
146143

0 commit comments

Comments
 (0)