Fix llvm-strip --only-keep-debug documentation for ELF
authorJames Henderson <james.henderson@sony.com>
Thu, 17 Mar 2022 11:36:42 +0000 (11:36 +0000)
committerJames Henderson <james.henderson@sony.com>
Fri, 18 Mar 2022 06:49:05 +0000 (06:49 +0000)
The functionality (and llvm-objcopy's corresponding documentation) was
added in
https://github.com/llvm/llvm-project/commit/5ad0103d8a04cb066dfae4fc20b0dfcd9413f4d4.
It looks like the llvm-strip docs to match were missed.

Reviewed by: gbreynoo

Differential Revision: https://reviews.llvm.org/D121902

llvm/docs/CommandGuide/llvm-strip.rst

index ce5c824..b077799 100644 (file)
@@ -59,6 +59,15 @@ multiple file formats.
  Write output to <file>. Multiple input files cannot be used in combination
  with -o.
 
+.. option:: --only-keep-debug
+
+ Produce a debug file as the output that only preserves contents of sections
+ useful for debugging purposes.
+
+ For ELF objects, this removes the contents of `SHF_ALLOC` sections that are not
+ `SHT_NOTE` by making them `SHT_NOBITS` and shrinking the program headers where
+ possible.
+
 .. option:: --regex
 
  If specified, symbol and section names specified by other switches are treated
@@ -129,18 +138,6 @@ multiple file formats.
 
  Read command-line options and commands from response file `<FILE>`.
 
-COFF-SPECIFIC OPTIONS
----------------------
-
-The following options are implemented only for COFF objects. If used with other
-objects, :program:`llvm-strip` will either emit an error or silently ignore
-them.
-
-.. option:: --only-keep-debug
-
- Remove the contents of non-debug sections from the output, but keep the section
- headers.
-
 ELF-SPECIFIC OPTIONS
 --------------------