Mail Archives: djgpp/1998/01/13/07:02:01
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 |
---------------------------------------------------------------------
- Raw text -