LLVM-STRIP(1)

๐Ÿ’… LLVM-STRIP(1) โ€” the LLVM manual, bestie edition ๐ŸŽ€

okay so you've stumbled into the LLVM corner of the man pages and honestly? you're gonna slay this. this is llvm-strip, the object stripping tool, and i'm gonna walk you through every single flag like we're texting at 2am. no cap, we're keeping all of it. โœจ


๐ŸŒธ NAME ๐ŸŒธ

llvm-strip โ€” object stripping tool. that's the whole vibe. it strips stuff. from objects. ๐Ÿ’…

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

llvm-strip [options] inputs...

๐Ÿ‘‘ DESCRIPTION ๐Ÿ‘‘

llvm-strip is a tool to strip sections and symbols from object files. if you don't specify any other stripping or remove options, --strip-all gets enabled automatically โ€” it's giving "default to maximal" and we respect it. ๐Ÿ’–

by default, the input files are modified in-place. and if you pass - as the input file, the input is read from the program's standard input stream. cute, right?

if the input is an archive, any requested operations will be applied to each archive member individually. every member gets the same treatment, no favorites. ๐Ÿซถ

ngl, the tool is still in active development โ€” but in most scenarios it works as a drop-in replacement for GNU's strip. so likeโ€ฆ go off, honestly.

โœจ GENERIC AND CROSS-PLATFORM OPTIONS โœจ

these ones are either agnostic of the file format, or apply to multiple file formats. equal opportunity options. ๐ŸŒˆ

  • --disable-deterministic-archives, -U โ€” use real values for UIDs, GIDs and timestamps when updating archive member headers. the authentic messy version. ๐Ÿ“
  • --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. two-for-one, iconic.
  • --enable-deterministic-archives, -D โ€” enable deterministic mode when stripping archives, i.e. use 0 for archive member header UIDs, GIDs and timestamp fields. it's on by default, so the vibes are already consistent. ๐Ÿ˜Œ
  • --help, -h โ€” print a summary of command line options. the "wait what were the flags again" button. ๐Ÿ™ˆ
  • --no-strip-all โ€” disable --strip-all. sometimes you don't want to strip everything, and that's valid.
  • -o <file> โ€” write output to <file>. multiple input files cannot be used in combination with -o โ€” it's strictly a one-input-one-output situation, don't push it. ๐Ÿ’€
  • --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. fancy. โœจ
  • --regex โ€” if specified, symbol and section names specified by other switches are treated as extended POSIX regular expression patterns. regex girlies rise. ๐Ÿ”ฅ
  • --remove-section <section>, -R โ€” remove the specified section from the output. can be specified multiple times to remove multiple sections simultaneously. stack 'em. ๐Ÿ’…
  • --strip-all-gnu โ€” remove all symbols, debug sections and relocations from the output. this option is equivalent to GNU strip's --strip-all switch. same energy, different font.
  • --strip-all, -s โ€” the big one. ๐Ÿ‘‘
    • 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 whole aliases, she's popular. ๐Ÿ’–
  • --strip-symbol <symbol>, -N โ€” remove all symbols named <symbol> from the output. can be specified multiple times to remove multiple symbols. bye bestie ๐Ÿ‘‹
  • --strip-unneeded โ€” remove from the output all local or undefined symbols that are not required by relocations. also remove all debug sections. ruthless and efficient.
  • --verbose, -v โ€” print the paths of files that are copied. narration on. ๐Ÿ—ฃ๏ธ
  • --version, -V โ€” display the version of the llvm-strip executable. who are you, really.
  • --wildcard, -w โ€” allow wildcard syntax for symbol-related flags. on by default for section-related flags. incompatible with --regex โ€” pick a lane, babe. โš”๏ธ

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 exception to the exception, we love her. ๐Ÿงš

the order of wildcards does not matter. for example, -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'. chaos-neutral. ๐Ÿ’œ

  • @<FILE> โ€” read command-line options and commands from response file <FILE>. your options, but in a little envelope. ๐Ÿ’Œ

๐Ÿงš ELF-SPECIFIC OPTIONS ๐Ÿงš

these are implemented only for ELF objects. if you use them with other objects, llvm-strip will either emit an error or silently ignore them โ€” so like, don't be surprised either way. ๐Ÿ˜ญ

  • --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. .L symbols, your time is up.
  • --keep-file-symbols โ€” keep symbols of type STT_FILE, even if they would otherwise be stripped. protection squad activated. ๐Ÿซถ
  • --keep-section <section> โ€” when removing sections from the output, do not remove sections named <section>. can be specified multiple times to keep multiple sections. no touchy. ๐Ÿ™…
  • --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. also no touchy.
  • --preserve-dates, -p โ€” preserve access and modification timestamps in the output. nostalgia preservation. ๐Ÿ•ฐ๏ธ
  • --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. like, seriously, bestie โ€” this is a real caveat, not a drill. ๐Ÿ˜ณ

๐Ÿ“ MACH-O-SPECIFIC OPTIONS ๐Ÿ“

these are implemented only for Mach-O objects. if you use them with other objects, llvm-strip will either emit an error or silently ignore them. same deal as above, different fruit.

  • -T โ€” remove Swift symbols. sorry swifties ๐Ÿ’”

๐ŸŒŸ EXIT STATUS ๐ŸŒŸ

llvm-strip exits with a non-zero exit code if there is an error. otherwise, it exits with code 0. simple as. โœ…

๐Ÿ› BUGS ๐Ÿ›

to report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip. tell them i sent you (don't, actually, they don't know me).

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

llvm-objcopy(1) <llvm-objcopy.html> โ€” her sister, also iconic.


๐ŸŒˆ Author ๐ŸŒˆ

maintained by the LLVM Team (https://llvm.org/). absolute legends, fr fr. ๐Ÿ™Œ

2003-2026, LLVM Project โ€” that's a long-running era, and we're obsessed. ๐Ÿ‘‘


alright bestie, that's the whole page, nothing skipped, every flag accounted for. mwah ๐Ÿ’‹

this has been page 23 of the LLVM manual, dated 2026-10-20, and yes โ€” LLVM-STRIP(1) at the top and bottom both. go strip something. slay. ๐Ÿ’…โœจ๐Ÿฆ‹
๐Ÿ“ฆ where this page comes from
  • arch rolling: llvm 23.1.4-1 ยท Apache-2.0 WITH LLVM-exception
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms