LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-13-2004, 01:37 AM   #1
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Rep: Reputation: 30
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)?
 
Old 02-13-2004, 02:56 AM   #2
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 30
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 .
 
Old 02-13-2004, 03:56 AM   #3
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Original Poster
Rep: Reputation: 30
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?
 
Old 02-13-2004, 06:02 AM   #4
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 30
For stripped binaries, do a strip over your binary file.

$ strip a.out
 
Old 02-13-2004, 06:11 AM   #5
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,171

Rep: Reputation: 51
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Stripped Down Kernel JohnFM3 Linux - General 6 06-02-2005 10:47 PM
Stripped down shell. homerz Programming 3 11-07-2003 01:02 PM
stripped down Linux? JustinBrown Linux - Software 12 07-25-2003 12:02 AM
Stripped||not stripped Cyth Linux - General 4 11-20-2001 01:47 PM
Stripped Firewall fenris@bu Linux - Security 1 07-10-2001 08:35 PM


All times are GMT -5. The time now is 11:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration