Subject: Re: lib/2758: crt0.o pulls in much of libc during linking
To: Mike Long <mike.long@analog.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: netbsd-bugs
Date: 09/15/1996 22:48:34
On Sun, 15 Sep 1996 23:06:41 -0400 (EDT)
Mike Long <mike.long@analog.com> wrote:
> >Description:
> crt0.o is supposed to be a mostly-standalone module. NetBSD's
> violates that rule because it uses strerror(), which uses catopen(),
> which uses...you get the idea.
>
> >How-To-Repeat:
>
> # cd /usr/src/bin/sync
> # make
>
> Wonder why /bin/sync is 36K when all it does is execute ONE SYSCALL.
>
> >Fix:
> Apply these patches to /usr/src/lib/csu/common.[ch]. After I
> did so, /bin/sync shrank from 36K to 12K; all of /bin shrank from
> 2729K to 2705K. (All right, so it's not a lot; but it's a start.)
There've been a few threads on this in the various BSD camps (and among
a group dealing with OSes where I work) ... Suggestions have ranged from
ripping out stdio in these programs (using write(STDOUT_FILENO, ...)
instead) to suggestions such as yours...
I guess it boils down to "where do you draw the line?" Are you willing
to give up potentially useful functionality (in this case, looking up
error messages in the message catalogue) or ease of implementation (not
using stdio :-) ... in many cases, the end (a marginal gain in disk
space) doesn't really justify the means...
On that note, I'd like to solicit other opinions on this subject...
-- save the ancient forests - http://www.bayarea.net/~thorpej/forest/ --
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: 408.866.1912
NAS: M/S 258-6 Work: 415.604.0935
Moffett Field, CA 94035 Pager: 415.428.6939