LLVM-STRIP(1)

πŸ“¦
version 11.1.0 Β· 2 versions
, in fedora 43, fedora 44

πŸ’… LLVM-STRIP β€” okay bestie, let's get you stripped (the object files, obviously) πŸ’…

Hiiii so this is the manual page for llvm-strip, aka LLVM-STRIP(1), and honestly? She's that girl. Let's go. πŸ¦‹


✨ NAME ✨

llvm-strip β€” the object stripping tool. That's it, that's the vibe. She removes stuff. Iconic behavior. πŸ’…


🌸 SYNOPSIS 🌸

llvm-strip [options] inputs...

Like, options, then your inputs, in that order. Periodt.


πŸŽ€ DESCRIPTION πŸŽ€

Okay so llvm-strip is a tool that strips sections and symbols out of object files. Fr fr, that's the whole job.

Here's the tea: if you don't specify any other stripping or remove options, --strip-all gets enabled automatically. No cap. You didn't ask for it, but she's doing it anyway. πŸ‘‘

By default, the input files are modified in-place β€” as in, she edits your files right where they sit, no copy, no backup, no take-backs. If you specify - 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. She's thorough like that. ✨

Lowkey important: the tool is still in active development, but in most scenarios it works as a drop-in replacement for GNU's strip. So like, she's still growing, but she's already carrying the whole group chat. 🌈


πŸ’– GENERIC AND CROSS-PLATFORM OPTIONS πŸ’–

The following options are either agnostic of the file format, or apply to multiple file formats. So they don't care what flavor of object file you're serving. Versatile queen. πŸ¦‹

  • --disable-deterministic-archives, -U β€” Use real values for UIDs, GIDs and timestamps when updating archive member headers. Like, actual real ones, not the polite 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. So "most", not "all", bestie β€” read the fine print. πŸ™ˆ
  • --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, so she's already doing this unless you tell her not to. πŸŽ€
  • --help, -h β€” Print a summary of command line options. Your lil cheat sheet. ✨
  • --no-strip-all β€” Disable --strip-all. The off switch for the automatic behavior described above. So polite of her to offer it.
  • -o <file> β€” Write output to <file>. Multiple input files cannot be used in combination with -o. One in, one out. That's the rule. πŸ’…
  • --regex β€” If specified, symbol and section names specified by other switches are treated as extended POSIX regular expression patterns. Fancy regex girlie mode. πŸ”₯
  • --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-all switch. So if you're coming from GNU land, this is your girl.
  • --strip-all, -S β€” For ELF objects, remove from the output all symbols and non-alloc sections not within segments, except for .gnu.warning, .ARM.attribute sections and the section name table. For COFF objects, remove all symbols, debug sections, and relocations from the output. Two flavors, one flag. 🌸
  • --strip-debug, -g β€” Remove all debug sections from the output. Bye bye debug info, you will not be missed. 😭
  • --strip-symbol <symbol>, -N β€” Remove all symbols named <symbol> from the output. Can be specified multiple times to remove multiple symbols. Pick and choose, we love a customizable queen. 🫢
  • --strip-unneeded β€” Remove from the output all local or undefined symbols that are not required by relocations. Also remove all debug sections. Two-for-one. ✨
  • --version, -V β€” Display the version of the llvm-strip executable. Gotta know which era of her you're working with. πŸ‘‘
  • --wildcard, -w β€” Allow wildcard syntax for symbol-related flags. On by default for section-related flags. Incompatible with --regex. Pick a lane bestie, you can't have both. πŸ’€

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 '*'. Chaos-friendly. 🌈

  • @<FILE> β€” Read command-line options and commands from response file <FILE>. For when your command line is, like, embarrassingly long.

🧚 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. So like, she might yell at you, or she might just... not acknowledge it. Either way, don't be surprised. πŸ™ˆ

  • --only-keep-debug β€” Remove the contents of non-debug sections from the output, but keep the section headers. Skeleton mode. Debug sections stay serving looks, everything else gets emptied out. πŸ’…

⭐ 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 energy as above, different file format. πŸ¦‹

  • --allow-broken-links β€” Allow llvm-strip to remove sections even if it would leave invalid section references. Any invalid sh_link fields will be set to zero. Chaotic permission granted. πŸ’€
  • --discard-locals, -X β€” Remove local symbols starting with ".L" from the output. Specifically those ones. Targeted. 🎯
  • --keep-file-symbols β€” Keep symbols of type STT_FILE, even if they would otherwise be stripped. Protected. 🫢
  • --keep-section <section> β€” When removing sections from the output, do not remove sections named <section>. Can be specified multiple times to keep multiple sections. Whitelist girlie. ✨
  • --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, symbols edition. πŸ’œ
  • --preserve-dates, -p β€” Preserve access and modification timestamps in the output. She'll leave your timestamps exactly as she found them. Respectful. 🌸
  • --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, many tools. This is a real one, bestie β€” not a drill.
  • -T β€” Remove Swift symbols. Just that. Short flag, big job. πŸ“

πŸ”₯ EXIT STATUS πŸ”₯

llvm-strip exits with a non-zero exit code if there is an error. Otherwise, it exits with code 0. Clean exit, clean conscience. ✨


πŸ’€ BUGS πŸ’€

To report bugs, please visit <https://bugs.llvm.org/>. She wants to hear from you, fr fr. 🫢


🌈 SEE ALSO 🌈

Her sister. Related content, iykyk. πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Maintained by the LLVM Team (https://llvm.org/). The whole team. Group project, and they're carrying. πŸŽ€


2003-2024, LLVM Project


And that's the whole page, bestie! This was LLVM-STRIP(1), version 11, dated 2024-07-18, straight from LLVM. Go forth and strip responsibly. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from