Date: Fri, 23 Nov 2001 10:52:32 +1100 From: Peter Jeremy <peter.jeremy@alcatel.com.au> To: Mark Murray <mark@grondar.za> Cc: Bruce Evans <bde@zeta.org.au>, Sheldon Hearn <sheldonh@starjuice.net>, Akinori MUSHA <knu@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/share/man/man1 builtin.1 src/bin/sh Makefile builtins.def sh.1 src/usr.bin/printf printf.1 Message-ID: <20011123105232.Q94635@gsmx07.alcatel.com.au> In-Reply-To: <200111221012.fAMACqN35344@grimreaper.grondar.org>; from mark@grondar.za on Thu, Nov 22, 2001 at 10:12:52AM %2B0000 References: <20011122015842.T9998-100000@delplex.bde.org> <bde@zeta.org.au> <200111221012.fAMACqN35344@grimreaper.grondar.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2001-Nov-22 10:12:52 +0000, Mark Murray <mark@grondar.za> wrote: >> The bloat in /bin/sh has very little to do with having printf in it. >> It has grown from 90K text in FreeBSD-1 to 590K text today. It is >> now 50% larger than the 3.5-year old bash-1 that I normally use. >> Most of the bloat is in libraries, mostly for getpwnam() (a null >> program statically linked to getpwnam() has size 300K text). >> getpwnam() is used solely for expansion of "~". This feature was >> left out of FreeBSD-1 to save 50K or so (getpwnam() was much less >> bloated in FreeBSD-1). > >You may be able to get getpwnam() a lot smaller by building without >YP (AKA NIS). As I see it, the options are: 1) Accept the bloat - which is probably OK except for PicoBSD and the install/fixit floppies where space is at a premium. 2) Drop the ability to do '~' expansion. 3) Have a small statically linked shell in /bin and an "all the bells and whistles" version in /usr/bin. 4) Arrange /bin/sh to dynamically load /usr/lib/libc.so if it's available when getpwnam() is called, otherwise use a staticly linked version that only uses /etc/passwd. Option 4 would seem to solve the bloat problem without losing the ability to ~-expand a YP username. (And if /usr isn't mounted, there's a reasable likelihood that the network isn't up so YP isn't available anyway). I'm less certain how practical this is since it requires the ability to try to dynamically link a library from an otherwise static executable when neither the library nor the loader may be available. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011123105232.Q94635>