LLVM-STRIP(1)
π LLVM-STRIP(1) β the LLVM manual, bestie edition β¨
okay so. you opened the LLVM manual page for llvm-strip and honestly? slay. let's get into it. πΈ
β¨ NAME β¨
llvm-strip β the object stripping tool π
β¨ SYNOPSIS β¨
llvm-strip [options] inputsβ¦
β¨ DESCRIPTION β¨
so llvm-strip is literally a tool that strips sections and symbols out of object files. that's the whole job. π
and here's the thing β if you don't specify any other stripping or remove options, --strip-all just turns itself on. it's giving main character energy, it decided for you. π
by default, the input files get modified in-place. and if you specify - as the input file, the input is read from the program's standard input stream instead. iconic behavior honestly.
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. ate. periodt. π₯
β¨ GENERIC AND CROSS-PLATFORM OPTIONS β¨
these options are either agnostic of the file format, or they apply to multiple file formats. so they're for everyone, no gatekeeping. π
--disable-deterministic-archives,-Uβ use real values for UIDs, GIDs and timestamps when updating archive member headers. no fake numbers, we're being honest here.--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. on by default, so it's already running the show.--help,-hβ print a summary of command line options. your little cheat sheet π--no-strip-allβ disable--strip-all. yes, you can turn off the thing that turns itself on.-o <file>β write output to<file>. multiple input files cannot be used in combination with-o. one output, one input, no drama. π--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_ALLOCsections that are notSHT_NOTEby making themSHT_NOBITSand shrinking the program headers where possible.
- for ELF objects, this removes the contents of
--regexβ if specified, symbol and section names specified by other switches are treated as extended POSIX regular expression patterns. fancy girl behavior β¨--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.--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.
--strip-debug,-d,-g,-Sβ remove all debug sections from the output. the debug sections are GONE. π--strip-symbol <symbol>,-Nβ remove all symbols named<symbol>from the output. can be specified multiple times to remove multiple symbols.--strip-unneededβ remove from the output all local or undefined symbols that are not required by relocations. also remove all debug sections.--version,-Vβ display the version of thellvm-stripexecutable.--wildcard,-wβ allow wildcard syntax for symbol-related flags. on by default for section-related flags. incompatible with--regex.
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 order of wildcards does not matter. for example, -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'.
@<FILE>β read command-line options and commands from response file<FILE>. π¦
β¨ ELF-SPECIFIC OPTIONS β¨
the following options 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, lowkey risky, be aware bestie. π§
--allow-broken-linksβ allowllvm-stripto remove sections even if it would leave invalid section references. any invalidsh_linkfields will be set to zero.--discard-locals,-Xβ remove local symbols starting with.Lfrom the output.--keep-file-symbolsβ keep symbols of typeSTT_FILE, even if they would otherwise be stripped. protecting them fr fr π«Ά--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-symbol <symbol>,-Kβ when removing symbols from the output, do not remove symbols named<symbol>. can be specified multiple times to keep multiple symbols.--preserve-dates,-pβ preserve access and modification timestamps in the output. the timestamps stay iconic. β--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, that's a real consequence, not a vibe, be careful. π-Tβ remove Swift symbols.
β¨ EXIT STATUS β¨
llvm-strip exits with a non-zero exit code if there is an error. otherwise, it exits with code 0. simple as that, no cap. β
β¨ BUGS β¨
to report bugs, please visit <https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip>. tell them everything, they wanna know π
β¨ SEE ALSO β¨
llvm-objcopy(1) β its sibling, its partner in crime, its other half π«Ά
β¨ AUTHOR β¨
maintained by the LLVM Team (https://llvm.org/). π
β¨ COPYRIGHT β¨
2003-2024, LLVM Project
and that's the whole page bestie, we made it ππ this was LLVM's LLVM-STRIP(1) manual, dated 2024-04-14, page 15 of the run β tysm for reading, you're literally the main character of this terminal session. slay, stay stripped, bye!! β¨π¦π
π¦ where this page comes from
- ubuntu noble: llvm-16 1:16.0.6-23ubuntu4 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms