LLVM-STRIP(1)
π LLVM-STRIP π
okay so bestie, welcome to the manual for llvm-strip β the object stripping tool that's literally the main character of binary cleanup. this page is from the LLVM Project, and we're gonna get into all of it. no cap. π«Ά
β¨ NAME β¨
llvm-strip β object stripping tool. that's the whole vibe. it strips sections and symbols from object files like it's decluttering its closet. π
π 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 "i got you" energy. β¨
by default, the input files are modified in-place. if you specify - for the input file, the input is read from the program's standard input stream. so you can pipe stuff in like it's a juice cleanse. π§
if the input is an archive, any requested operations will be applied to each archive member individually. yes, it goes through them one by one. thorough queen. π
the tool is still in active development, but in most scenarios it works as a drop-in replacement for GNU's strip. so you can lowkey just use it. iykyk. π
π GENERIC AND CROSS-PLATFORM OPTIONS π
the following options are either agnostic of the file format, or apply to multiple file formats. they're flexible like that. π
--disable-deterministic-archives,-Uβ use real values for UIDs, GIDs and timestamps when updating archive member headers. this is the "keep it real" option. no fake zeroes. π--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. so not everything, but a lot. π--enable-deterministic-archives,-Dβ enable deterministic mode when stripping archives, i.e. use0for archive member header UIDs, GIDs and timestamp fields. this is on by default. so zeroes are the default vibe. β¨--help,-hβ print a summary of command line options. you know, the classic "what does this thing do again?" button. π«Ά--no-strip-allβ disable--strip-all. sometimes you don't want to go all the way. and that's valid. π-o <file>β write output to <file>. multiple input files cannot be used in combination with-o. it's a one-on-one situation. no group projects. π--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 like keeping only the receipts you actually need. π§Ύ
--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. if you're coming from GNU, it's the 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. it's the full send. π₯
--strip-debug,-d,-g,-Sβ remove all debug sections from the output. bye bye debug info. π--strip-symbol <symbol>,-Nβ remove all symbols named <symbol> from the output. can be specified multiple times to remove multiple symbols. targeted removal. π―--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. periodt. π--version,-Vβ display the version of thellvm-stripexecutable. know your queen's era. πΈ--wildcard,-wβ allow wildcard syntax for symbol-related flags. on by default for section-related flags. incompatible withβregex. so you can't have both. 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]
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. exclusion era. π«
the order of wildcards does not matter. for example, -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'. so don't stress about the order. it's not that deep. π¦
@<FILE>β read command-line options and commands from response file <FILE>. it's like a little note that tells you what to do. π
π§ 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 if you're not on ELF, it might just 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. it's giving "messy but make it work". π«Ά--discard-locals,-Xβ remove local symbols starting with.Lfrom the output. specifically the.Lgirlies. β¨--keep-file-symbolsβ keep symbols of typeSTT_FILE, even if they would otherwise be stripped. protect the file symbols at all costs. π‘οΈ--keep-section <section>β when removing sections from the output, do not remove sections named <section>. can be specified multiple times to keep multiple sections. protect your faves. π--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. π--preserve-dates,-pβ preserve access and modification timestamps in the output. time is precious. β°--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. so like, be careful. this can break things. π-Tβ remove Swift symbols. swifties, look away. π
π EXIT STATUS π
llvm-strip exits with a non-zero exit code if there is an error. otherwise, it exits with code 0. so 0 is the slay outcome. β¨
π BUGS π
to report bugs, please visit the link below. don't suffer in silence, bestie. π«Ά
<β https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip>
πΈ SEE ALSO πΈ
llvm-objcopy(1) β the sibling icon. go check it out. π
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). they're the ones keeping this whole thing going. π
π COPYRIGHT π
2003-2023, LLVM Project
and that's the whole page, bestie. this manual is from the LLVM Project, version 15, dated 2023-07-14. iconic. periodt. π β¨
π¦ where this page comes from
- ubuntu jammy: llvm-15 1:15.0.7-0ubuntu0.22.04.3 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms