SSTRIP(1)
SSTRIP π
okay bestie, welcome to the sstrip manual page, from the General Commands Manual section of your friendly neighbourhood Unix docs. sit down, grab a boba, we're gonna make your binaries β¨smallerβ¨
πΈ NAME πΈ
sstrip β truncates ELF files to remove non-program content. it's giving "snip snip, bye bye bloat" βοΈ
π¦ SYNOPSIS π¦
sstrip [OPTIONS] FILE ...
π DESCRIPTION π
so like, sstrip removes the content at the end of an ELF file that does not contribute to a program's memory image. basically the stuff that's just sitting there at the tail end of your binary doing absolutely nothing for the actual running program? gone. not invited to the party. π
and the way it does it is very in place β sstrip modifies the named file in place, rather than outputting new contents to another location. so no new file, no copy, no "where did my original go" moment. it edits the file you gave it, right there. main character energy fr fr π
β¨ OPTIONS β¨
-z,--zeroesβ attempt to also strip trailing zero bytes from the file. like, yes queen, get those zeros too π--helpβ display help and exit. the classic "help me bestie" button π«Ά--versionβ display version information and exit. for when you need to know which era of sstrip you're dealing with π
π§ NOTES π§
okay so here's the lore. sstrip works by identifying the parts of an ELF binary file that are loaded into memory when executed, and then truncating the file to remove everything beyond that point. it's literally finding the "this part actually matters" line and cutting everything after it. slay. βοΈ
typically this means removing the section header table and various other tables that are not needed by the program loader. not needed = not staying. bye π
here's a big one though, listen up: a shared-object library stripped in this fashion will still be usable by the dynamic linker, but not by the static linker. like, it will still work for one of them and absolutely will not for the other. that's the vibe check result, no cap.
β οΈ and now the dramatic part: the use of the option to delete trailing zero bytes can sometimes cause a binary to not function (depending on which ELF structure was truncated as a result). yes, genuinely. it can break your baby. π since this feature typically reduces a file size by only a handful of bytes anyway, it is only useful in rare circumstances. so like, the risk-to-reward is not giving. only reach for -z when the situation is truly that girl.
π COPYRIGHT π
Copyright Β© 1999 Brian Raiter <breadbox@muppetlabs.com>. π«Ά
License GPLv2+: GNU GPL version 2 or later. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (yes the no-warranty is in all caps in the original too, it's that serious π )
π SEE ALSO π
strip(1)β the other one, iykyk π
ELF kickers 3.0 Β· May 2011 Β· SSTRIP(1)
and that's the whole page bestie, mwah π go forth and truncate responsibly π¦β¨
π¦ where this page comes from
- arch rolling: elfkickers 3.2-6 Β· GPL-2.0-or-later
- debian trixie: elfkickers 0+git20240221+ds-5
- nixos 26.05: elfkickers 3.2
- nixpkgs unstable: elfkickers 3.2
- ubuntu resolute: elfkickers 3.2+ds-1
- ubuntu stonking: elfkickers 3.2+ds-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms