Re: dead-code stripping, is it possible?
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.