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. use0for 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 ofSHF_ALLOCsections that are notSHT_NOTEby making themSHT_NOBITSand 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 GNUstrip's--strip-allswitch. 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.attributesections 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.*.
- for ELF objects: remove from the output all symbols and non-alloc sections not within segments, except for
--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 thellvm-stripexecutable. 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โ allowllvm-stripto remove sections even if it would leave invalid section references. any invalidsh_linkfields will be set to zero. chaotic but consensual. ๐--discard-locals,-Xโ remove local symbols starting with".L"not referenced by relocations from the output..Lsymbols, your time is up.--keep-file-symbolsโ keep symbols of typeSTT_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. ๐
๐ Copyright ๐
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 page23of theLLVMmanual, dated2026-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