LLVM-STRIP(1)

πŸ“¦ version 23.1.3, in centos-stream 9

✨ LLVM-STRIP(1) ✨

okay so bestie, welcome to the llvm-strip glow-up πŸ’… this is the LLVM manual page, and it's literally the object stripping tool of your dreams.


🌸 SYNOPSIS 🌸

llvm-strip [options] inputs...

πŸŽ€ DESCRIPTION πŸŽ€

llvm-strip is the tool that strips sections and symbols from object files, and honestly? it ate. πŸ”₯ If you don't specify any other stripping or remove options, --strip-all gets enabled β€” automatic, no cap.

By default your input files get modified in-place (yes, the way that it just goes in and edits them, iconic but be careful babe πŸ™ˆ). If - is specified for the input file, the input is read from the program's standard input stream instead.

If the input is an archive, any requested operations get applied to each archive member individually β€” every single one, fr fr.

The tool is still in active development, but in most scenarios it works as a drop-in replacement for GNU's strip. main character energy, honestly. πŸ‘‘


πŸ’œ GENERIC AND CROSS-PLATFORM OPTIONS πŸ’œ

These ones are either agnostic of the file format, or they apply to multiple file formats. versatile queens. ✨

  • --disable-deterministic-archives, -U β€” Use real values for UIDs, GIDs and timestamps when updating archive member headers. (the chaos mode option, lowkey)
  • --discard-all, -x β€” Remove most local symbols not referenced by relocations 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.
  • --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. your little helper bestie 🫢
  • --no-strip-all β€” Disable --strip-all. the uno-reverse card πŸ’€
  • -o <file> β€” Write output to <file>. Multiple input files cannot be used in combination with -o β€” pick one, babe.
  • --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. (i know, so much jargon, but it's giving precise πŸŽ€)

  • --regex β€” If specified, symbol and section names specified by other switches are treated as extended POSIX regular expression patterns.
  • --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.
  • --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 and Mach-O objects, remove all symbols, debug sections, and relocations from the output.

For WebAssembly objects, remove all custom sections except for those named metadata.code.*.

  • --strip-debug, -d, -g, -S β€” Remove all debug sections from the output. four aliases, one slay πŸ’…
  • --strip-symbol <symbol>, -N β€” Remove all symbols named <symbol> from the output. Can be specified multiple times to remove multiple symbols.
  • --strip-unneeded β€” Remove from the output all local or undefined symbols that are not required by relocations. Also remove all debug sections.
  • --verbose, -v β€” Print the paths of files that are copied.
  • --version, -V β€” Display the version of the llvm-strip executable.
  • --wildcard, -w β€” Allow wildcard syntax for symbol-related flags. On by default for section-related flags. Incompatible with --regex β€” you can't have both, sorry bestie.

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. so iconic honestly.

The order of wildcards does not matter. For example, -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'. it's giving chill vibes only πŸ¦‹

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

🧚 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. (rude, but okay πŸ™ˆ)

  • --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 not referenced by relocations from the output.
  • --keep-file-symbols β€” Keep symbols of type STT_FILE, even if they would otherwise be stripped. protect them 🫢
  • --keep-section <section> β€” When removing sections from the output, do not remove sections named <section>. Can be specified multiple times to keep multiple sections.
  • --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.
  • --preserve-dates, -p β€” Preserve access and modification timestamps in the output.
  • --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. you've been warned, bestie. this is the risky one 😭

🌈 MACH-O-SPECIFIC OPTIONS 🌈

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

  • -T β€” Remove Swift symbols. bye swiftie πŸ‘‹πŸ’œ

⭐ EXIT STATUS ⭐

llvm-strip exits with a non-zero exit code if there is an error. Otherwise, it exits with code 0. clean exit, no drama. ✨


πŸ¦‹ BUGS πŸ¦‹

To report bugs, please visit <https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip>. tell them everything, they wanna know πŸŽ€


πŸ’– SEE ALSO πŸ’–

llvm-objcopy(1) β€” its sibling, also iconic


πŸ‘‘ AUTHOR πŸ‘‘

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


2003-2026, LLVM Project


okay that's the whole page bestie, you're so welcome πŸ’… and yeah β€” this was LLVM 23, dated 2026-10-06, from the LLVM manual set. now go strip something and slay ✨🫢

πŸ“¦ where this page comes from