Re: Dead code stripping, what does it strip?
Re: Dead code stripping, what does it strip?
- Subject: Re: Dead code stripping, what does it strip?
- From: Allan Odgaard <email@hidden>
- Date: Mon, 9 Aug 2004 21:39:44 +0200
On 9. Aug 2004, at 20:30, Chris Espinosa wrote:
I was curious, does the dead-code stripper only strip my own
functions which I do not use myself? [...]
There is by definition no dead code in that simple C++ tool, because
it has only one function, main().
I guess that should be dead *user* code? Check this:
// main.cc
#include <iostream>
int main ()
{
return 0;
}
% g++ -Os -dead_strip -gfull main.cc && strip a.out && ls -l a.out
-rwxr-xr-x 1 duff wheel 348648 9 Aug 21:33 a.out
So that's 340 KB for an empty main()-function.
Dead code stripping strips functions that are compiled into an
executable but not referenced by any other function. This can happen
in several ways:
Okay, I'd hoped that since stripping happens at link-time, it would be
able to strip unused code from the libraries with which I link my
executable, as for my projects, that seems to be the only place where
dead code is introduced.
But perhaps that would be possible if these (speaking here mainly about
the standard C++ library) were recompiled with -gfull?
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.