This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Statically linked binary way way too big


Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua> 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 -- james@and.org
:0:
* ^From: .*james@and\.org
/dev/null


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]