LLVM-STRIP(1)

πŸ“¦ version 15.0.7, in opensuse-leap 16.0

πŸ’… LLVM-STRIP(1) πŸ’…

okay so bestie, this is the LLVM manual page for llvm-strip, and it's giving object-file makeover energy. It's a tool that strips sections and symbols from object files. We're gonna go through every flag, no skips, no cap. 🫢


πŸŽ€ NAME πŸŽ€

llvm-strip β€” object stripping tool. literally what it says on the tin: it strips sections and symbols from object files.

✨ SYNOPSIS ✨

llvm-strip [options] inputs...

🌸 DESCRIPTION 🌸

llvm-strip is a tool to strip sections and symbols from object files. If no other stripping or remove options are specified, --strip-all will be enabled. That's the default vibe check.

By default, the input files are modified in-place. If - is specified for the input file, the input is read from the program's standard input stream. stdin girlies rise. 🧚

If the input is an archive, any requested operations will be applied to each archive member individually. Yes, each member gets its own little glow-up.

The tool is still in active development, but in most scenarios it works as a drop-in replacement for GNU's strip. not me being a work-in-progress icon 😭

🫢 GENERIC AND CROSS-PLATFORM OPTIONS 🫢

The following options are either agnostic of the file format, or apply to multiple file formats. universal queen behavior.

  • --disable-deterministic-archives, -U β€” Use real values for UIDs, GIDs and timestamps when updating archive member headers. real values only, bestie.
  • --discard-all, -x β€” Remove most local symbols from the output. Different file formats may limit this to a subset of the local symbols. For example, file and section symbols in ELF objects will not be discarded. Additionally, remove all debug sections. most, not all β€” read the fine print.
  • --enable-deterministic-archives, -D β€” Enable deterministic mode when stripping archives, i.e. use 0 for archive member header UIDs, GIDs and timestamp fields. On by default.
  • --help, -h β€” Print a summary of command line options. the classic "what do I do again?" button.
  • --no-strip-all β€” Disable --strip-all. the anti-default, if you will.
  • -o <file> β€” Write output to <file>. Multiple input files cannot be used in combination with -o. one output file, one main character.
  • --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. debug-only era.
  • --regex β€” If specified, symbol and section names specified by other switches are treated as extended POSIX regular expression patterns. regex girlies, assemble.
  • --remove-section <section>, -R β€” Remove the specified section from the output. Can be specified multiple times to remove multiple sections simultaneously. stack 'em up.
  • --strip-all-gnu β€” Remove all symbols, debug sections and relocations from the output. This option is equivalent to GNU strip's --strip-all switch. GNU-compatible slay.
  • --strip-all, -s β€” For ELF objects, remove from the output all symbols and non-alloc sections not within segments, except for .gnu.warning, .ARM.attribute sections and the section name table. For COFF objects, remove all symbols, debug sections, and relocations from the output. big strip energy.
  • --strip-debug, -d, -g, -S β€” Remove all debug sections from the output. bye-bye debug info.
  • --strip-symbol <symbol>, -N β€” Remove all symbols named <symbol> from the output. Can be specified multiple times to remove multiple symbols. name by name, symbol by symbol.
  • --strip-unneeded β€” Remove from the output all local or undefined symbols that are not required by relocations. Also remove all debug sections. if it's not needed, it's not invited.
  • --version, -V β€” Display the version of the llvm-strip executable. version check, bestie.
  • --wildcard, -w β€” Allow wildcard syntax for symbol-related flags. On by default for section-related flags. Incompatible with --regex. no regex + wildcard chaos, pick a lane.

Wildcard syntax allows the following special symbols:

  • * β€” Any number of characters, equivalent to .*
  • ? β€” Any single character, equivalent to .
  • \ β€” Escape the next character, equivalent to \
  • [a-z] β€” Character class, equivalent to [a-z]
  • [!a-z], [^a-z] β€” Negated character class, equivalent to [^a-z]

Additionally, starting a wildcard with '!' will prevent a match, even if another flag matches. For example -w -N '*' -N '!x' will strip all symbols except for x. the bang symbol is giving veto power.

The order of wildcards does not matter. For example, -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'. order is literally not the vibe.

  • @<FILE> β€” Read command-line options and commands from response file <FILE>. response file bestie.

πŸ¦‹ ELF-SPECIFIC OPTIONS πŸ¦‹

The following options are implemented only for ELF objects. If used with other objects, llvm-strip will either emit an error or silently ignore them. ELF-only, no gatekeeping.

  • --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. chaotic but consensual.
  • --discard-locals, -X β€” Remove local symbols starting with ".L" from the output. girlies, you're out.
  • --keep-file-symbols β€” Keep symbols of type STT_FILE, even if they would otherwise be stripped. file symbols stay winning.
  • --keep-section <section> β€” When removing sections from the output, do not remove sections named <section>. Can be specified multiple times to keep multiple sections. protected section list.
  • --keep-symbol <symbol>, -K β€” When removing symbols from the output, do not remove symbols named <symbol>. Can be specified multiple times to keep multiple symbols. VIP symbols only.
  • --preserve-dates, -p β€” Preserve access and modification timestamps in the output. timestamps stay cute.
  • --strip-sections β€” Remove from the output all section headers and all section data not within segments. Note that many tools will not be able to use an object without section headers. ⚠️ real talk: no section headers can break tools.
  • -T β€” Remove Swift symbols. Swift symbols, bye.

πŸšͺ EXIT STATUS πŸšͺ

llvm-strip exits with a non-zero exit code if there is an error. Otherwise, it exits with code 0. zero means slay, non-zero means something's up πŸ’….

πŸ› BUGS πŸ›

To report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip. the bug report portal is right there.

πŸ‘€ SEE ALSO πŸ‘€

llvm-objcopy(1) β€” the sibling icon.

πŸ‘‘ AUTHOR πŸ‘‘

Maintained by the LLVM Team (https://llvm.org/). the maintainers are the moment.

2003-2023, LLVM Project. respect the copyright, bestie.


byeee πŸ’– this was LLVM-STRIP(1) from the LLVM project, page version 15, dated 2023-01-14 β€” slay and stay stripped ✨

πŸ“¦ where this page comes from