• 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, is it possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dead-code stripping, is it possible?


  • Subject: Re: dead-code stripping, is it possible?
  • From: Jim Ingham <email@hidden>
  • Date: Tue, 1 Jun 2004 22:05:22 -0700

On Jun 1, 2004, at 4:17 PM, Marshall Clow wrote:

Is it possible to have the linker strip dead code? Is there an option to
enable this?

Usually, there isn't any dead code to strip.

I believe you are mistaken.

As people build up libraries of useful functions, they tend to link against these libraries.
Many times they only need a small fraction of the functions in these libraries, and many of us,
like the OP, expect(ed) the linker to remove the unused functions from the final binary.




This is not a comment either way about the merits of dead code stripping, but just a clarification.


The static linker does perform "unused code stripping" on the level of a module already. If you link a library into an app that doesn't use any of the functions from a particular .c file, then the linker will omit that module from the final link. So if you get used to keeping the .c files in your libraries small and focused, then there won't be much dead code to strip.

Of course, if you always had a linker that dead-code stripped, there would be no motivation to do this, and so you will end up with lots of dead code that gets included...

Jim
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Jim Ingham email@hidden
Developer Tools - gdb
_______________________________________________
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.



  • Follow-Ups:
    • Re: dead-code stripping, is it possible?
      • From: Wiley Hodges <email@hidden>
References: 
 >Re: dead-code stripping, is it possible? (From: Markus Hitter <email@hidden>)
 >Re: dead-code stripping, is it possible? (From: Marshall Clow <email@hidden>)

  • Prev by Date: Re: dead-code stripping, is it possible?
  • Next by Date: New on XCode: need help building large C++ code
  • Previous by thread: Re: dead-code stripping, is it possible?
  • Next by thread: Re: dead-code stripping, is it possible?
  • Index(es):
    • Date
    • Thread