LLVM-STRIP(1)
π LLVM-STRIP(1) π
okay bestie, welcome to the llvm-strip page, from the LLVM manual set. sit down, grab a strawberry, we're gonna learn how to strip object files and it's gonna be iconic πβ¨
β¨ NAME β¨
llvm-strip β object stripping tool. that's it, that's the whole vibe. it strips sections and symbols out of object files. slay π
πΈ SYNOPSIS πΈ
llvm-strip [options] inputs...
π¦ DESCRIPTION π¦
so llvm-strip is literally 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 just turns on, like, on its own. main character energy fr fr π
by default the input files get modified in-place. and if you specify - for 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 get applied to each archive member individually. one by one, no skipping π
ngl the tool is still in active development, but in most scenarios it works as a drop-in replacement for GNU's strip. lowkey a legend for that π«Ά
π GENERIC AND CROSS-PLATFORM OPTIONS π
the following options are either agnostic of the file format, or apply to multiple file formats. they're the universal besties β¨
--disable-deterministic-archives,-Uβ use real values for UIDs, GIDs and timestamps when updating archive member headers. like, the actual ones. no pretending π--discard-all,-xβ remove most local symbols 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. bye bestie π--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. periodt π--help,-hβ print a summary of command line options. the classic. the icon π--no-strip-allβ disable--strip-all. yeah, it does exactly what it says, no plot twist π-o<file> β write output to file. multiple input files cannot be used in combination with-o. pick one, bestie, you can't have both π--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. very technical, very demure β¨
--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-allswitch. it's giving "same energy" π«Ά--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. nuke it π₯
--strip-debug,-d,-g,-Sβ remove all debug sections from the output. four aliases, one job, we love a multitasker π--strip-symbol<symbol>,-Nβ remove all symbols named symbol from the output. can be specified multiple times to remove multiple symbols. bye bye bye π--strip-unneededβ remove from the output all local or undefined symbols that are not required by relocations. also remove all debug sections. if it's not needed, it's gone β¨--version,-Vβ display the version of thellvm-stripexecutable. flex the build info π--wildcard,-wβ allow wildcard syntax for symbol-related flags. on by default for section-related flags. incompatible with--regex. you can't have both, it's giving situationship drama π
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 audacity of that x, honestly, keeping its symbol while everyone else gets yeeted π
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. little@doing big things π
π 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. it's giving "exclusive club only" π§
--allow-broken-linksβ allowllvm-stripto remove sections even if it would leave invalid section references. any invalidsh_linkfields will be set to zero. messy but make it functional π--discard-locals,-Xβ remove local symbols starting with".L"from the output..L-girlies, your time is up π--keep-file-symbolsβ keep symbols of typeSTT_FILE, even if they would otherwise be stripped. protected, shielded, blessed π‘οΈβ¨--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, keep, keep π--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. your faves are safe π--preserve-dates,-pβ preserve access and modification timestamps in the output. time is a construct but timestamps are sacred β°--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 "you'll regret it" moment, proceed with caution β οΈ-Tβ remove Swift symbols. swifties, i'm so sorry π π«Ά
π EXIT STATUS π
llvm-strip exits with a non-zero exit code if there is an error. otherwise, it exits with code 0. zero is the slay number, anything else means something went wrong bestie π
π BUGS π
to report bugs, please visit:
https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip
go tell them what's wrong, they want to know, we're all in this together π«Ά
π SEE ALSO π
llvm-objcopy(1) β its sibling, its partner in crime, iykyk π
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). icons, honestly π
π COPYRIGHT π
2003-2025, LLVM Project
okay that's the whole page bestie, you're officially a llvm-strip expert now, go strip something πβ¨
this has been the LLVM-STRIP(1) page, page 20, dated 2025-09-03, from LLVM. mwah, love u, bye ππ¦πΈ
π¦ where this page comes from
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms