From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Strip.exe Date: Sat, 10 Jan 1998 22:46:44 -0500 Organization: Two pounds of chaos and a pinch of salt. Lines: 33 Message-ID: <34B840A4.1B93@cs.com> References: <19980110 DOT 124745 DOT 4374 DOT 0 DOT matthew DOT krause AT juno DOT com> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp232.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Matthew R Krause wrote: > > What exactly does strip.exe do -- I've noticed it shrinks the size of my > executables by ~40-50%, but how? 'strip.exe' performs the same function as the '-s' switch to the linker; it removes all symbol information from a program image. Since this information can represent a sizeable part of the object code, removing it can shrink your programs without affecting their operation in any way. However, there's a reason why that symbol information exists. Even when you don't specify an option like '-g', gcc still includes the symbols so that 'ld' knows how to link the object code. This information is also used by debugging tools like 'gdb' and 'symify' to display information about your program. Once the symbol table is gone, your programs cannot be debugged. If you are concerned about final executable size, then it's fairly common to distribute stripped executables, but keep a copy that has full debugging information for yourself. Then, if a user reports a crash, you can compare the stack dump with your debugging-enabled version to find out what went wrong. hth! -- --------------------------------------------------------------------- | John M. Aldrich | "Sin lies only in hurting other | | aka Fighteer I | people unnecessarily. All other | | mailto:fighteer AT cs DOT com | 'sins' are invented nonsense." | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------