LLVM-STRIP(1)
π llvm-strip β the LLVM manual page, but make it make sense
okay so bestie, welcome to llvm-strip(1), a.k.a. the LLVM object stripping tool, and honestly? it's kind of the main character of binary slimming. pull up a chair π
β¨ NAME β¨
llvm-strip β object stripping tool π§
β¨ SYNOPSIS β¨
llvm-strip [options] inputs...
β¨ DESCRIPTION β¨
llvm-strip is the tool that strips sections and symbols out of object files. like, it takes your chunky binary and goes "bestie, we're decluttering." π§Ή
here's the vibe check on how it behaves: if you don't specify any other stripping or remove options, --strip-all gets enabled automatically. no cap. that's just the default.
by default, the input files get modified in-place. yep, in place. so if you're the type to not have backups... π if you pass - as the input file, though, 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 β one by one, like a lil assembly line π«Ά
and ngl, 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 understudy who ate π
β¨ GENERIC AND CROSS-PLATFORM OPTIONS β¨
these ones are either agnostic of the file format, or they apply to multiple file formats. versatile icons only π
--disable-deterministic-archives,-Uβ use real values for UIDs, GIDs and timestamps when updating archive member headers. the unfiltered truth β¨--discard-all,-xβ remove most local symbols from the output. heads up: 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. and also it removes all debug sections too. two-for-one π--enable-deterministic-archives,-Dβ enable deterministic mode when stripping archives, i.e. use0for archive member header UIDs, GIDs and timestamp fields. this one's on by default, so it's already slaying π--help,-hβ print a summary of command line options. when you're lost, ask the tool π--no-strip-allβ disable--strip-all. the anti-strip-all agenda π-o <file>β write output to <file>. but listen: multiple input files cannot be used in combination with-o. one output, one input situation, no polyamory π--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 ofSHF_ALLOCsections that are notSHT_NOTEby making themSHT_NOBITSand shrinking the program headers where possible. it's giving "keep only the lore" π--regexβ if specified, symbol and section names specified by other switches are treated as extended POSIX regular expression patterns. fancy regex mode π--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-allswitch. GNU cosplay, but make it accurate π«Ά--strip-all,-sβ for ELF objects, remove from the output all symbols and non-alloc sections not within segments, except for.gnu.warning,.ARM.attributesections and the section name table. for COFF objects, remove all symbols, debug sections, and relocations from the output. the heavy hitter π₯--strip-debug,-d,-g,-Sβ remove all debug sections from the output. bye debug info, you were iconic π--strip-symbol <symbol>,-Nβ remove all symbols named <symbol> from the output. can be specified multiple times to remove multiple symbols. targeted takedowns β--strip-unneededβ remove from the output all local or undefined symbols that are not required by relocations. also removes all debug sections. if it's not needed, it's not staying π--version,-Vβ display the version of thellvm-stripexecutable. identity check β¨--wildcard,-wβ allow wildcard syntax for symbol-related flags. on by default for section-related flags. incompatible with--regexβ pick a lane 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]
and 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 exclusion era π
ββοΈ
also the order of wildcards does not matter. for example -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'. chaos-agnostic π
@<FILE>β read command-line options and commands from response file <FILE>. bring your options in a bag π
β¨ ELF-SPECIFIC OPTIONS β¨
these ones 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, it might ghost you π
--allow-broken-linksβ allowllvm-stripto remove sections even if it would leave invalid section references. any invalidsh_linkfields will be set to zero. living dangerously, we love to see it π«Ά--discard-locals,-Xβ remove local symbols starting with".L"from the output..L-sweep π§Ή--keep-file-symbolsβ keep symbols of typeSTT_FILE, even if they would otherwise be stripped. protection spell β¨--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 VIP 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, symbol edition π--preserve-dates,-pβ preserve access and modification timestamps in the output. respect the original timestamps π°οΈ--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, fr fr, this is the dangerous one, don't say I didn't warn you π-Tβ remove Swift symbols. swiftie cleanup era π¦
β¨ EXIT STATUS β¨
llvm-strip exits with a non-zero exit code if there is an error. otherwise, it exits with code 0. so 0 = slay, non-zero = something's up π
β¨ BUGS β¨
to report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip. (that path is literally tools:llvm-objcopy%2Fstrip, %2F being a /, iykyk.) go tell them what's broken, they want to know π
β¨ SEE ALSO β¨
llvm-objcopy(1) β the sibling, the other half of the duo π
β¨ AUTHOR β¨
maintained by the LLVM Team (https://llvm.org/). the icons behind the curtain π
β¨ COPYRIGHT β¨
2003-2025, LLVM Project β all the legal lore π
aight that's the whole page bestie, no skips, no cuts, every flag accounted for πΈ
and finally, the cute sign-off: this was page 19 of the manual, dated 2025-01-17, and it's LLVM-STRIP(1) β go strip something, responsibly πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: llvm19 19.1.7-160000.2.2 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm19 19.1.7-160000.2.2 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm19 19.1.7-160000.2.2 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm19 19.1.7-160000.2.2 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms