LLVM-STRIP(1)

πŸ’– llvm-strip β€” the manual, but make it cute πŸ’–

okay bestie, welcome to LLVM-STRIP(1) from the LLVM manual collection, section 1. this is the page that tells you how to strip your object files down to their best self. let's go πŸ¦‹


✨ NAME ✨

llvm-strip β€” object stripping tool

like. that's it. that's the whole job. it strips. it's an icon, it's a legend, and it's the moment. πŸ’…


🌸 SYNOPSIS 🌸

llvm-strip [options] inputs...

options first, then as many inputs as your heart desires. that's the whole vibe check. ✨


πŸŽ€ DESCRIPTION πŸŽ€

so llvm-strip is a tool that strips sections and symbols out of object files. periodt.

and here's the part that gets people β€” if you don't specify any other stripping or remove options, --strip-all will be enabled. like it just turns itself on. main character behavior fr fr. πŸ‘‘

by default, the input files are modified in-place. no copy, no backup, it's editing your files right where they live. 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 will be applied to each archive member individually. every single one. no member left behind. 😭

the tool is still in active development, but in most scenarios it works as a drop-in replacement for GNU's strip. it's giving "new but already slaying." πŸ’œ

🌈 GENERIC AND CROSS-PLATFORM OPTIONS 🌈

these options are either agnostic of the file format, or they apply to multiple file formats. equal opportunity options. we love that for them. ✨

  • --disable-deterministic-archives, -U β€” use real values for UIDs, GIDs and timestamps when updating archive member headers. no more zeroes, we're being authentic here. πŸ’–
  • --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. so it's thorough but not that thorough, iykyk. 🧚
  • --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. so if you never touched it, congrats, it's already on bestie. πŸ’…
  • --help, -h β€” print a summary of command line options. your little cheat sheet. πŸŽ€
  • --no-strip-all β€” disable --strip-all. sometimes you gotta say no to the default. boundaries. πŸ›‘
  • -o <file> β€” write output to <file>. note: multiple input files cannot be used in combination with -o. it's one in, one out. no polyamory here bestie. πŸ™ˆ
  • --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. it's the "keep only the important lore" option. ⭐
  • --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 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. the classic. the blueprint. the blueprint classic. πŸ‘‘
  • --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. yes it's a lot, yes it's on by default if you don't pick anything else, no we're not discussing it. 😭
  • --strip-debug, -d, -g, -S β€” remove all debug sections from the output. four whole aliases for one job. she contains multitudes. 🌸
  • --strip-symbol <symbol>, -N β€” remove all symbols named <symbol> from the output. can be specified multiple times to remove multiple symbols. targeted. precise. iconic. 🎯
  • --strip-unneeded β€” remove from the output all local or undefined symbols that are not required by relocations. also remove all debug sections. it's the "you're not needed here, and also your debug sections are gone" combo. πŸ’€
  • --version, -V β€” display the version of the llvm-strip executable. always good to know who you're talking to. ✨
  • --wildcard, -w β€” allow wildcard syntax for symbol-related flags. on by default for section-related flags. incompatible with --regex. so pick a lane bestie, it's wildcards or regex, not both. πŸ¦‹

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 exclamation mark is the "not you" of the wildcard world. πŸ’…

the order of wildcards does not matter. for example, -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'. order is fake, results are real. 🫢

  • @<FILE> β€” read command-line options and commands from response file <FILE>. yes you can put your whole personality in a file and reference it. πŸ’–

πŸ’œ 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. so it's either "excuse me" or "i saw nothing." both valid. πŸ™ˆ

  • --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? maybe. but consensual chaos, you asked for it. πŸ”₯
  • --discard-locals, -X β€” remove local symbols starting with ".L" not referenced by relocations from the output. the .L girlies are on notice. πŸ’€
  • --keep-file-symbols β€” keep symbols of type STT_FILE, even if they would otherwise be stripped. protective. nurturing. we stan. πŸŽ€
  • --keep-section <section> β€” when removing sections from the output, do not remove sections named <section>. can be specified multiple times to keep multiple sections. the "not this one" 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. same energy, different noun. 🌸
  • --preserve-dates, -p β€” preserve access and modification timestamps in the output. your file's little birthday stays intact. πŸŽ‚
  • --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. this is a real warning bestie, like genuinely, a lot of tools will simply look at your object file and go "what is this." proceed with intention. 😭

πŸ¦‹ 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. same deal as before. πŸ’…

  • -T β€” remove Swift symbols. that's it. one letter, one job, no notes. πŸ‘‘

✨ EXIT STATUS ✨

llvm-strip exits with a non-zero exit code if there is an error. otherwise, it exits with code 0. so like. 0 means we ate. non-zero means we did not. πŸ’–


πŸ’€ BUGS πŸ’€

to report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip. they want to hear from you, genuinely, go tell them. 🫢


🌈 SEE ALSO 🌈

llvm-objcopy(1) <llvm-objcopy.html> β€” her sister. her collaborator. the other half of the duo. go read that one next bestie. πŸ’œ


πŸ‘‘ Author πŸ‘‘

maintained by the LLVM Team (https://llvm.org/). the whole squad. 🫢


2003-2026, LLVM Project. iconic longevity fr fr. ⭐


and that's the whole page!! this was LLVM-STRIP(1) from the LLVM manual, and you're reading this on the version where the date is 2026-07-16 β€” which is also the day this page number rolled around, page 22 of the manual. so like. remember that. it's part of the lore. πŸ’…βœ¨ bye bestie, go strip something (responsibly) πŸ¦‹πŸ’–

πŸ“¦ where this page comes from