Re: dead-code stripping, is it possible?
Re: dead-code stripping, is it possible?
- Subject: Re: dead-code stripping, is it possible?
- From: Marshall Clow <email@hidden>
- Date: Tue, 1 Jun 2004 16:17:07 -0700
At 11:37 PM +0200 6/1/04, Markus Hitter wrote:
Am 01.06.2004 um 18:24 schrieb Kevin Hoyt:
Now let's say that I don't care if other applications fail if they
attempt to link against my statically linked binary...
"Other applications" means your own application as well as soon as
you have more than one huge binary.
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.
All those frameworks you link against already exist somewhere and
don't take up additional disk space if you link against them.
For memory usage, those frameworks are mapped into memory, i.e. it's
loaded just what you need, rounded up to the next 4 KB boundary.
Same for bundles & dynamic libraries.
That's dynamic linking, not static.
In static linking, the object code is included into your application.
Exception are dead functions in your own sources and linking against
static libraries. Both take disk space but not neccessarily memory.
That's what we're talking about.
Disk space is a resource too, especially when you distribute electronically.
Bandwidth is a resource. If I can save 200K out of a download, and
it's downloaded 5000
times, that is 1 Gigabyte of bandwidth that I do not have to pay for.
Yet you have the reason why static linking is kind of depreceated in
OS X and why none of the common binaries, not even the kernel ist
statically linked.
MacOS is not distributed electronically.
It ships on a bunch of CDs. Apple can afford to waste space.
--
-- Marshall
Marshall Clow Idio Software <mailto:email@hidden>
I want a machine that thinks I'm more important than it is, and acts like it.
-- Eric Herrmann
_______________________________________________
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.