• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dead code stripping, what does it strip?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.



References: 
 >Dead code stripping, what does it strip? (From: Allan Odgaard <email@hidden>)
 >Re: Dead code stripping, what does it strip? (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: How do I access the project target editor?
  • Next by Date: Re: Lost functionality in 1.5: debug jump
  • Previous by thread: Re: Dead code stripping, what does it strip?
  • Next by thread: Re: Xcode usability (was Re: Where did the GDB drawer go?)
  • Index(es):
    • Date
    • Thread