LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   stripped/non-stripped binaries (https://www.linuxquestions.org/questions/linux-general-1/stripped-non-stripped-binaries-145562/)

spuzzzzzzz 02-13-2004 01:37 AM

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)?

UltimaGuy 02-13-2004 02:56 AM

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 :).

spuzzzzzzz 02-13-2004 03:56 AM

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?

UltimaGuy 02-13-2004 06:02 AM

For stripped binaries, do a strip over your binary file.

$ strip a.out

whansard 02-13-2004 06:11 AM

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.