Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm just wondering if stripping a program file has more benefits than just saving disk space.

share|improve this question
    
does it save cpu or memory? –  user57077 Nov 1 '10 at 4:08
    
On embedded systems where storage is tight it will save some disk space. –  Zoredache Nov 1 '10 at 7:07
    
Saves a wee bit on memory. –  symcbean Nov 1 '10 at 10:38

3 Answers 3

The primary benefit, for the vast majority of cases, is just to save disk space. A secondary, and much more dubious benefit, is that it also makes the binary more difficult to disassemble or reverse engineer. It may also reduce the memory footprint a little, though in many cases it'll be a negligible savings.

The biggest detriment is that it makes debugging significantly more difficult if you run into a problem.

On a modern system with CPU speeds what they are, and memory/disk quantities what they are, stripping a binary will have very little practical impact on performance in any way. It's really about debugging, "cleanliness", and personal preferences. Some people prefer to always used stripped binaries for production or "shipped" software. Some people prefer to always leave the symbols included, "just in case".

Personally, I prefer to have symbols included. I've had a couple of really frustrating situations over the year where a commercial application was segfaulting (or otherwise crashing) and I had no ability to pinpoint where the problem was, because the binaries were stripped. In at least a few of those cases, the vendor ended up sending me a non-stripped version to run with, until it crashed again, so we could get more useful debugging information. Had they provided the non-stripped version in the beginning, we could have resolved the problem faster and with less downtime.

share|improve this answer
1  
Agreed unless you are in a memory-constrained, embedded system like the 32MB NSLU2. Every byte in RAM counts and shaving 10% off a binary is very common in those scenarios. I have likewise attached gdb to a dying or dead process and would have been up a creek had it not been for the unstripped symbols. My take is that stripping symbols is only for memory conservation and better cache-line usage. But test the latter because optimization may ignore your expectations. –  zerolagtime Nov 1 '10 at 18:15
    
You make an excellent point. My above comments are valid for the typical desktop/laptop or server usage scenarios, but stripping binaries is often a huge win in embedded and special use systems. –  Christopher Cashell Nov 1 '10 at 18:33

It's harder to disassemble, as all the function and symbol names are gone, so you're left with function1 or varB.

share|improve this answer

you can compile software with debug symbols for testing and then just strip them out for deployment. if your debugging symbols expose something you would rather not expose, this might be of use to you

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.