Strip, a tool for executing files in UNIX [reprint]

Source: Internet
Author: User
Tags uncompress

Http: // 203.208.37.132/search? Q = cache: e8evvowg0juj: cached

The compress command for File compression in UNIX is familiar to everyone. It has a high compression ratio. It is most appropriate to use it with the tar command for data backup. However, compress compression also has a disadvantage, that is, the compressed file must be decompressed with the uncompress command before it can be used properly. UseStripThe command does not solve this problem. It can clear unnecessary identifiers and debugging information in the execution file and reduce the file size without affecting normal use. However, unlike compressStripAnd cannot be restored, soStripIs a weight lossToolsInstead of CompressionTools. In additionStripAfter the file does not contain debugging information, you cannot use DBX to debug the program. Now let's take a look at the specific effect. Let's look at the following program:
# Include
Main ()
{
Printf ("Hello, world/N ");
}
Compiled with CC, the length is 46176 bytes.StripThen it is changed to 30648, which is fully reduced by 1/3 and can still be executed normally. BesidesStripIn addition, the use of shared libraries is also a way to reduce the execution file length.
Note:
1. If the file size is not reduced, it is alreadyStripPassed.
2. added the "-s" parameter during CC compilation, which has the same effect.
Some space-saving method:
That is, you can write a zexec script for a single large executable file. The script below is only for/usr/bin/CC
Uncompress./CC. Z
Mv cc/tmp
CD/tmp
./CC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.