stripped/non-stripped binaries
Does anyone know the difference between stripped and non-stripped binaries? Is there a reason to prefer one over the other? How do you go about creating stripped binaries (I can only seem to manage non-stripped)?
|
Non-stripped binaries have debigging info built into them. The option is "gcc -g <progname>". Stripped binaries doesn't have this extra baggage, and are a lot smaller :).
|
This is what I get with compiling a simple file:
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), not stripped I have tried with different options including -g, -O, -O3, but it is always non-stripped. The -g option produced a file that was about twice as big as the others. Is it possible that the "gcc -g" file was the only non-stripped one and my "file" command is acting funny? |
For stripped binaries, do a strip over your binary file.
$ strip a.out |
if you look at man strip
you'll see there are different symbols you can take out. sometimes you'll strip stuff and the program will not work anymore. strip --strip-debug is probably the safest. |
All times are GMT -5. The time now is 06:18 AM. |