Misplaced Pages

strip (Unix)

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Standard UNIX utility
This article needs additional citations for verification. Please help improve this article by adding 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)
strip
Original author(s)Dennis Ritchie
(AT&T Bell Laboratories)
Developer(s)Various open-source and commercial developers
Initial releaseJune 12, 1972; 52 years ago (1972-06-12)
Written inC
Operating systemUnix, Unix-like, Plan 9, Microsoft Windows
PlatformCross-platform
TypeCommand
LicensePlan 9: MIT License

In Unix, Plan 9, and Unix-like operating systems, the strip program is a command-line utility used to remove non-essential information from executable binary programs and object files. This information, which is not required for execution, typically includes debugging data, symbol tables, relocation information, and other metadata. Its primary purpose is to reduce the file size of the binary executable and potentially increase performance. The output of this process is known as a stripped binary.

Description

strip is a GNU binary utility that is used to remove information in a compiled binary or object file that is not needed for its execution. This information typically includes debugging information and symbol tables; however, the exact scope of the changes made to the binary is left to the discretion of the program's implementer by using the command-line options.

Using strip can enhance the security of a binary by making it more difficult to reverse-engineer. The absence of symbol and debugging information complicates the program analysis of the binary.

The effect of strip can also be achieved directly by using the compiler or linker to perform the same process. A compiler is a program that translates source code written in a high-level programming language (like C or C++) into machine 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 single executable file, resolving any symbol references between them.

For example, in the GNU Compiler Collection (GCC), this is done by using the "-s” option with gcc. This tells the linker to remove debugging information and symbols during the linking process, resulting in a smaller, stripped executable.

The GNU Project ships an implementation of strip as part of the GNU Binutils package. strip has been ported to other operating systems including Microsoft Windows.

See also

References

  1. "Linux Strip Command". www.computerhope.com. Retrieved 2024-10-01.
  2. ^ "What is the difference between "gcc -s" and a "strip" command?". Stack Overflow. Retrieved 2024-10-01.

External links

Unix command-line interface programs and shell builtins
File system
Processes
User environment
Text processing
Shell builtins
Searching
Documentation
Software development
Miscellaneous
Plan 9 command-line interface programs and shell builtins
File system
Processes
User environment
Text processing
Shell builtins
Networking
Searching
Software development
Miscellaneous
Categories: