This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Strip" Unix – news ·newspapers ·books ·scholar ·JSTOR(December 2020) (Learn how and when to remove this message) |
Original author(s) | Dennis Ritchie (AT&T Bell Laboratories) |
---|---|
Developer(s) | Variousopen-source andcommercial developers |
Initial release | June 12, 1972; 52 years ago (1972-06-12) |
Written in | C |
Operating system | Unix,Unix-like,Plan 9,Microsoft Windows |
Platform | Cross-platform |
Type | Command |
License | Plan 9:MIT License |
InUnix,Plan 9, andUnix-likeoperating systems, thestrip
program is acommand-line utility used to remove non-essential information fromexecutablebinary programs andobject files. This information, which is not required forexecution, typically includesdebugging data,symbol tables,relocation information, and othermetadata. Its primary purpose is to reduce thefile size of the binary executable and potentially increase performance. The output of this process is known as astripped binary.
strip
is aGNU binary utility that is used to remove information in a compiled binary orobject file that is not needed for itsexecution. This information typically includesdebugging information andsymbol tables; however, the exact scope of the changes made to the binary is left to the discretion of the program's implementer by using thecommand-line options.[1]
Usingstrip
can enhance the security of a binary by making it more difficult toreverse-engineer. The absence of symbol and debugging information complicates theprogram analysis of the binary.
The effect ofstrip
can also be achieved directly by using thecompiler orlinker to perform the same process. A compiler is a program that translatessource code written in ahigh-level programming language (likeC orC++) intomachine code that the computer’s processor can execute. A linker, on the other hand, takes one or more object files generated by the compiler and combines them into a singleexecutable file, resolving any symbolreferences between them.[2]
For example, in theGNU Compiler Collection (GCC), this is done by using the "-s
” option withgcc
. This tells the linker to remove debugging information and symbols during the linking process, resulting in a smaller, stripped executable.[2]
TheGNU Project ships an implementation ofstrip
as part of theGNU Binutils package.strip
has beenported to other operating systems includingMicrosoft Windows.
strip
– Shell and Utilities Reference,The Single UNIX Specification, Version 4 fromThe Open Groupstrip(1)
– Plan 9 Programmer's Manual, Volume 1