LLVM-STRIP(1)
π LLVM-STRIP(1) π
okay so bestie, this is the LLVM manual page for llvm-strip, and it's giving object-file makeover energy. It's a tool that strips sections and symbols from object files. We're gonna go through every flag, no skips, no cap. π«Ά
π NAME π
llvm-strip β object stripping tool. literally what it says on the tin: it strips sections and symbols from object files.
β¨ SYNOPSIS β¨
llvm-strip [options] inputs...
πΈ DESCRIPTION πΈ
llvm-strip is a tool to strip sections and symbols from object files. If no other stripping or remove options are specified, --strip-all will be enabled. That's the default vibe check.
By default, the input files are modified in-place. If - is specified for the input file, the input is read from the program's standard input stream. stdin girlies rise. π§
If the input is an archive, any requested operations will be applied to each archive member individually. Yes, each member gets its own little glow-up.
The tool is still in active development, but in most scenarios it works as a drop-in replacement for GNU's strip. not me being a work-in-progress icon π
π«Ά GENERIC AND CROSS-PLATFORM OPTIONS π«Ά
The following options are either agnostic of the file format, or apply to multiple file formats. universal queen behavior.
--disable-deterministic-archives,-Uβ Use real values for UIDs, GIDs and timestamps when updating archive member headers. real values only, bestie.--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. most, not all β read the fine print.--enable-deterministic-archives,-Dβ Enable deterministic mode when stripping archives, i.e. use0for archive member header UIDs, GIDs and timestamp fields. On by default.--help,-hβ Print a summary of command line options. the classic "what do I do again?" button.--no-strip-allβ Disable--strip-all. the anti-default, if you will.-o <file>β Write output to<file>. Multiple input files cannot be used in combination with-o. one output file, one main character.--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. debug-only era.--regexβ If specified, symbol and section names specified by other switches are treated as extended POSIX regular expression patterns. regex girlies, assemble.--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. GNU-compatible slay.--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. big strip energy.--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. name by name, symbol by symbol.--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 not invited.--version,-Vβ Display the version of thellvm-stripexecutable. version check, bestie.--wildcard,-wβ Allow wildcard syntax for symbol-related flags. On by default for section-related flags. Incompatible with--regex. no regex + wildcard chaos, pick a lane.
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 bang symbol is giving veto power.
The order of wildcards does not matter. For example, -w -N '*' -N '!x' is the same as -w -N '!x' -N '*'. order is literally not the vibe.
@<FILE>β Read command-line options and commands from response file<FILE>. response file bestie.
π¦ 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. ELF-only, no gatekeeping.
--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"from the output. girlies, you're out.--keep-file-symbolsβ Keep symbols of typeSTT_FILE, even if they would otherwise be stripped. file symbols stay winning.--keep-section <section>β When removing sections from the output, do not remove sections named<section>. Can be specified multiple times to keep multiple sections. protected section 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 symbols only.--preserve-dates,-pβ Preserve access and modification timestamps in the output. timestamps stay cute.--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. β οΈ real talk: no section headers can break tools.-Tβ Remove Swift symbols. Swift symbols, bye.
πͺ EXIT STATUS πͺ
llvm-strip exits with a non-zero exit code if there is an error. Otherwise, it exits with code 0. zero means slay, non-zero means something's up π
.
π BUGS π
To report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy%2Fstrip. the bug report portal is right there.
π SEE ALSO π
llvm-objcopy(1) β the sibling icon.
π AUTHOR π
Maintained by the LLVM Team (https://llvm.org/). the maintainers are the moment.
Β©οΈ COPYRIGHT Β©οΈ
2003-2023, LLVM Project. respect the copyright, bestie.
byeee π this was LLVM-STRIP(1) from the LLVM project, page version 15, dated 2023-01-14 β slay and stay stripped β¨
π¦ where this page comes from
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms