Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-27-2006, 07:38 AM
|
#1
|
|
Member
Registered: Oct 2003
Posts: 354
Rep:
|
about strip
Hello everyone,
Could anyone show me how to use strip under Linux, for example, strip -s. I have read the Linux man manual of strip, but more confused after reading it.
I am also wondering in what situations do you use it?
thanks in advance,
George
|
|
|
|
08-27-2006, 08:23 AM
|
#2
|
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OL
Posts: 9,311
|
Quote:
|
Originally Posted by George2
Could anyone show me how to use strip under Linux, for example, strip -s.
|
strip -s file
Quote:
|
I have read the Linux man manual of strip, but more confused after reading it.
|
What part is confusing you ?
Quote:
|
I am also wondering in what situations do you use it?
|
Here are two use cases:
you want your binary file to be smaller in size.
you want to hide symbols from a proprietary program to make reverse engineering more difficult.
|
|
|
|
08-28-2006, 02:49 AM
|
#3
|
|
Member
Registered: Oct 2003
Posts: 354
Original Poster
Rep:
|
Thank you jlliagre,
Quote:
|
Originally Posted by jlliagre
strip -s file
What part is confusing you ?
Here are two use cases:
you want your binary file to be smaller in size.
you want to hide symbols from a proprietary program to make reverse engineering more difficult.
|
What makes me confused is that, in the man page, it is mentioned that strip -s will remove all symbols. I do not know what are the symbols in the context, but if they are exported symbols (functions/variables), and when they are removed, how could other module use the exported functions/variables?
regards,
George
|
|
|
|
08-28-2006, 10:22 AM
|
#4
|
|
Member
Registered: May 2002
Posts: 964
Rep:
|
He means that strip removes a human readable symbol table - like the one you see with
A long time ago, stripped executables loaded and ran faster than the same file that was not stripped. Today, you might strip files to make them smaller for a distribution package.
|
|
|
|
08-28-2006, 10:36 AM
|
#5
|
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OL
Posts: 9,311
|
Indeed, either the manual page is wrong or an object would be made unusable after "strip -s".
I'll let you test which one is true. I would tend to believe it is the former, and only unnecessary symbol are stripped, but who knows ...
|
|
|
|
08-28-2006, 11:08 AM
|
#6
|
|
Member
Registered: Oct 2003
Posts: 354
Original Poster
Rep:
|
Thank you Jim!
Quote:
|
Originally Posted by jim mcnamara
He means that strip removes a human readable symbol table - like the one you see with
A long time ago, stripped executables loaded and ran faster than the same file that was not stripped. Today, you might strip files to make them smaller for a distribution package.
|
If I make a debug mode build of application, then if I remove such symbol table, could the debugger work properly? Because I think without a human readable information symbol table, how could the person who makes the debug assignment know the meaning of each internal symbol?
regards,
George
|
|
|
|
08-28-2006, 11:10 AM
|
#7
|
|
Member
Registered: Oct 2003
Posts: 354
Original Poster
Rep:
|
Hi jlliagre,
Quote:
|
Originally Posted by jlliagre
Indeed, either the manual page is wrong or an object would be made unusable after "strip -s".
I'll let you test which one is true. I would tend to believe it is the former, and only unnecessary symbol are stripped, but who knows ...
|
If they are unnecessary as you mentioned, why could compiler/linker generate such unnecessary symbol table?
regards,
George
|
|
|
|
08-28-2006, 01:52 PM
|
#8
|
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OL
Posts: 9,311
|
They are only unnecessary for executing the program, but they are very valuable for post mortem crash analysis and debug.
|
|
|
|
08-29-2006, 08:55 AM
|
#9
|
|
Member
Registered: May 2002
Posts: 964
Rep:
|
It's a value call- unstripped image files use more space and some more memory, but you need them when things go bad, like for core analysis with gdb.
strip is there because strip has been part of UNIX for looong time. It's utility is simply how you perceive it: strip is good or strip is bad or strip is neutral.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
id3lib Strip?
|
bendeco13 |
Programming |
0 |
04-04-2006 02:10 AM |
|
strip -s
|
blackzone |
Linux - Newbie |
1 |
09-01-2004 12:08 AM |
|
strip command?
|
blackzone |
Linux - General |
2 |
07-09-2004 03:20 AM |
|
Why strip binaries?
|
rsamurti |
Slackware |
4 |
06-27-2004 04:17 PM |
|
strip poker
|
JROCK1980 |
Linux - Games |
7 |
04-10-2004 12:40 AM |
All times are GMT -5. The time now is 05:57 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|