This is the mail archive of the
mailing list for the glibc project.
Re: Statically linked binary way way too big
- From: James Antill <james at and dot org>
- To: vda at port dot imtp dot ilyichevsk dot odessa dot ua
- Cc: libc-alpha at sources dot redhat dot com
- Date: 16 Oct 2002 02:22:47 -0400
- Subject: Re: Statically linked binary way way too big
- References: <200210160532.g9G5Wwp28222@Port.imtp.ilyichevsk.odessa.ua>
Denis Vlasenko <firstname.lastname@example.org> writes:
> I needed to statically link an application.
> I ended up with a.out of 406400 bytes after strip.
> Based on release announcements ("we don't want
> to hear about size") and discussions with Linus
> seen in archive I know that glibc does not try
> to minimize library size, but nearly half a megabyte
> can never be right.
Yes, that's to be expected, mainly because the startup code pulls in a
lot of things even if you aren't using them for instance the symbol
table has 1260 entries in it for a simple exit (EXIT_SUCCESS); program.
dietlibc on the other hand is 1.3K bytes and strips to 522 bytes, but
then it's headers are weird and wonderful to say the least, resolving
only seems to work on fully qualified hostnames and it's sprintf() is
a joke ... but if you don't want to use anything but exit() then it
only has 19 symbols, and works just as well.
# James Antill -- email@example.com
* ^From: .*james@and\.org