LLVM-STRIP(1)
π LLVM-STRIP(1) β the LLVM manual, bestie edition π
okay so this is llvm-strip, and it lives in the LLVM manual section 1. yes we're doing this, grab a drink π
β¨ NAME β¨
llvm-strip β object stripping tool. that's it, that's the whole vibe check: it strips stuff out of object files π
πΈ SYNOPSIS πΈ
llvm-strip [options] inputsβ¦
π¦ DESCRIPTION π¦
so llvm-strip is a tool to strip sections and symbols from object files. literally its whole personality. and listen β if you don't specify any other stripping or remove options, --strip-all gets enabled automatically. the tool just goes "say less" and strips everything π
By default, the input files are modified in-place (yes, the original files, no undo, be careful bestie π). 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. highkey iconic behavior ngl π
β GENERIC AND CROSS-PLATFORM OPTIONS β
these ones are either agnostic of the file format, or apply to multiple file formats. equal opportunity options, we love to see it π
--disable-deterministic-archives,-Uβ Use real values for UIDs, GIDs and timestamps when updating archive member headers. i.e. the actual real-world values, not the fakey zeros β¨--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 it's "most", not "all", the flag name is lowkey lying to you π--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. yes bestie it's already on, you're fine π--help,-hβ Print a summary of command line options. your lil cheat sheet π--no-strip-allβ Disable--strip-all. the anti-strip-all button, for when you need to chill π-o<file> β Write output to <file>. Multiple input files cannot be used in combination with-o. one file in, one file out, that's the rule π«--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. for the GNU stans π«Ά--strip-all,-sβ okay this one'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 objects, remove all symbols, debug sections, and relocations from the output.
- 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 flags for one job, she's flexible π--strip-symbol<symbol>,-Nβ Remove all symbols named <symbol> from the output. Can be specified multiple times to remove multiple symbols. bye bye to whoever you name π--strip-unneededβ Remove from the output all local or undefined symbols that are not required by relocations. Also remove all debug sections. if nothing needs it, it's gone, periodt β¨--version,-Vβ Display the version of thellvm-stripexecutable. which girlboss era are we in π--wildcard,-wβ Allow wildcard syntax for symbol-related flags. On by default for section-related flags. Incompatible with--regex(pick a lane bestie, they can't both be main character π€).
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 ! is the bodyguard of the group chat π
The order of wildcards does not matter. For example, -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'. order? never heard of her πΈ
- *
@<FILE*> β Read command-line options and commands from response file <FILE>. the "here's my whole list, don't @ me" option, except... do @ it π©
π₯ COFF-SPECIFIC OPTIONS π₯
The following options are implemented only for COFF objects. If used with other objects, llvm-strip will either emit an error or silently ignore them. it's giving exclusive club, no cap π
--only-keep-debugβ Remove the contents of non-debug sections from the output, but keep the section headers. keep the skeleton, drop the meat π¦΄
π 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. same exclusive-energy, different format π
--allow-broken-linksβ Allowllvm-stripto remove sections even if it would leave invalid section references. Any invalidsh_linkfields will be set to zero. letting her break things on purpose, we respect the chaos π--discard-locals,-Xβ Remove local symbols starting with.Lfrom the output..Lsymbols are SO last season ποΈ--keep-file-symbolsβ Keep symbols of typeSTT_FILE, even if they would otherwise be stripped. protect them 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. the protected 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. VIP pass for symbols ποΈ--preserve-dates,-pβ Preserve access and modification timestamps in the output. her memory is impeccable π--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, for real for real, a lot of tools will just give you the π face-Tβ Remove Swift symbols. swifties getting removed, sorry not sorry π
π EXIT STATUS π
llvm-strip exits with a non-zero exit code if there is an error. Otherwise, it exits with code 0. so 0 means slay, anything else means something went wrong π
π BUGS π
To report bugs, please visit <https://bugs.llvm.org/>. tell them everything, they want the tea π΅
π§ SEE ALSO π§
llvm-objcopy(1)β her sibling, her costar, her other half π
π AUTHOR π
Maintained by the LLVM Team (https://llvm.org/). collectively iconic π
π COPYRIGHT π
2003-2023, LLVM Project
okay that's the whole page bestie, go strip something responsibly π«Άβ¨
sign-off: this masterpiece of a manual page is version 13, dated 2023-07-14, and yeah β it's LLVM-STRIP(1) all day, every day π
π
π¦ where this page comes from
- ubuntu jammy: llvm-13 1:13.0.1-2ubuntu2.2 Β· 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