what is this little application for?
When using it without any options reduces the size of the executables, but how/what it does?
strip is a GNU utility to "strip" symbols from object files. This is useful for minimizing their file size, streamlining them for distribution. It can also be useful for making it more difficult to reverse-engineer the compiled code.
@Droider:- strip is something which can be run on an object file which is already compiled. It also has a variety of command-line options which you can use to configure which information will be removed. For example, -g strips only the debug information which gcc -g adds.
A stripped binary is a program that is compiled with a strip flag that tells the compiler to discard these debugging symbols and compile to program as it is. Stripping a binary reduces its size on the disk and makes it a little more difficult to debug and reverse engineer.
To remove debugging symbols from a binary (which must be an a. out or ELF binary), run strip --strip-debug filename. Wildcards can be used to treat multiple files (use something like strip --strip-debug $LFS/tools/bin/*).
From the (Mac OS X, but others are similar) man page:
strip removes or modifies the symbol table attached to the output of the assembler and link editor. This is useful to save space after a program has been debugged and to limit dynamically bound symbols.
Note the bit about "after a program has been debugged" because debugging a stripped executable is very hard, indeed. The "limit dynamically bound symbols" is a rarer use: it lets you make some of the functions in an external library inaccessible by taking away the index entries that tell where the actual code is located. This is also explained in the man page.
As cheap and plentiful as disk is in most situation you simply wouldn't bother with this anymore. But you might want it for space constrained situation like embeded devices, rescue disks, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With