diff --git a/llvm/docs/CommandGuide/llvm-strip.md b/llvm/docs/CommandGuide/llvm-strip.md deleted file mode 100644 --- a/llvm/docs/CommandGuide/llvm-strip.md +++ /dev/null @@ -1,16 +0,0 @@ -# llvm-strip - object stripping tool - -## SYNOPSIS - -**llvm-strip** [*options*] - -## DESCRIPTION - -**llvm-strip** is a tool to strip sections and symbols from object files. - -The tool is still in active development, but in most scenarios it works as a -drop-in replacement for GNU's **strip**. - -## SEE ALSO - -[llvm-objcopy](llvm-objcopy.html) diff --git a/llvm/docs/CommandGuide/llvm-strip.rst b/llvm/docs/CommandGuide/llvm-strip.rst new file mode 100644 --- /dev/null +++ b/llvm/docs/CommandGuide/llvm-strip.rst @@ -0,0 +1,138 @@ +llvm-strip - object stripping tool +============================================== + +.. program:: llvm-strip + +SYNOPSIS +-------- + +:program:`llvm-strip` [*options*] *input* [*output*] + +DESCRIPTION +----------- + +:program:`llvm-strip` is a tool to strip sections and symbols from object files. + +The tool is still in active development, but in most scenarios it works as a +drop-in replacement for GNU's :program:`strip`. + +GENERIC AND CROSS-PLATFORM OPTIONS +---------------------------------- + +The following options are either agnostic of the file format, or apply to +multiple file formats. + +.. option:: --disable-deterministic-archives + + Disable deterministic mode when stripping archives (use real values for UIDs, GIDs, and timestamps). + +.. option:: --discard-all + + Remove all local symbols except file and section symbols. + +.. option:: --discard-locals + + Remove compiler-generated local symbols, (e.g. symbols starting with .L). + +.. option:: --enable-deterministic-archives, -D + + Enable deterministic mode when stripping archives (use zero for UIDs, GIDs, and timestamps). + +.. option:: --no-strip-all + + Disable --strip-all. + +.. option:: -o file + + Write output to . + +.. option:: --preserve-dates + + Preserve access and modification timestamps. + +.. option:: --regex + + Permit regular expressions in name comparison. + +.. option:: --remove-section=section + + Remove
. + +.. option:: --strip-all-gnu + + Compatible with GNU strip's --strip-all. + +.. option:: --strip-all + + Remove non-allocated sections outside segments. .gnu.warning* sections are not removed. + +.. option:: --strip-debug + + Remove debugging symbols only. + +.. option:: --strip-symbol=symbol + + Strip . + +.. option:: --strip-unneeded + + Remove all symbols not needed by relocations. + +.. option:: -U + + Alias for --disable-deterministic-archives. + +.. option:: --version + + Print the version and exit. + +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 + + Clear sections that would not be stripped by --strip-debug. Currently only implemented for COFF. + +ELF-SPECIFIC OPTIONS +-------------------- + +The following options are implemented only for ELF objects. If used with other +objects, :program:`llvm-strip` will either emit an error or silently ignore +them. + +.. option:: --allow-broken-links + + Allow llvm-strip to remove sections even if it would leave invalid section + references. Any invalid sh_link fields will be set to zero. + +.. option:: --keep-file-symbols + + Do not remove file symbols. + +.. option:: --keep-section=section + + Keep
. + +.. option:: --keep-symbol=symbol + + Do not remove symbol . + +EXIT STATUS +----------- + +:program:`llvm-strip` exits with a non-zero exit code if there is an error. +Otherwise, it exits with code 0. + +BUGS +---- + +To report bugs, please visit . + +SEE ALSO +-------- + +:manpage:`llvm-objcopy(1)` diff --git a/llvm/tools/llvm-objcopy/StripOpts.td b/llvm/tools/llvm-objcopy/StripOpts.td --- a/llvm/tools/llvm-objcopy/StripOpts.td +++ b/llvm/tools/llvm-objcopy/StripOpts.td @@ -32,7 +32,8 @@ Alias, HelpText<"Alias for --disable-deterministic-archives">; -def output : JoinedOrSeparate<["-"], "o">, HelpText<"Write output to ">; +def output : JoinedOrSeparate<["-"], "o">, HelpText<"Write output to ">, + MetaVarName<"file">; def preserve_dates : Flag<["--"], "preserve-dates">, HelpText<"Preserve access and modification timestamps">;