How to put glibc-2.2.2 on a diet...

Yves Rutschle
Fri Jun 22 08:33:00 GMT 2001

> I'm putting together my embedded Linux system, and I want to
> statically link my applications since I only have about 10 of them in
> total (init, expand, mount, ifconfig, route, etc...), as well as
> libc.a by itself is 10+Mb.

Hmm, my is 1.1Mb, that for arm-linux. I realise that different
processors and OS are going to make a difference, but that still
looks suspiciously big. Is is possible that you are compiling
debugging symbols in?

> So when I statically link the hellow world application, 
> here's what I get:
> [/tmp] > echo 'main() { printf("hello world\n"); }' > hello.c
> [/tmp] > powerpc-linux-gcc -static -Wl,-Map, hello.c -o hello
> [/tmp] > powerpc-linux-size hello
>    text	   data	    bss	    dec	    hex	filename
>  256252	   4124	   3348	 263724	  4062c	hello
> Note that the text segment is a quarter of a Meg!!!  And 
> that's after I hacked out 100Kb of dcgettext() stuff.

Try powerpc-linux-strip hello ?

That said, my experience with glibc is that it's worth sharing
it if there are more than 3 executables, precisely because the
start code is so huge (I can't remember what kind of size, but
200 Kb sounds "normal" (normal in terms of Glibc that is) ).


Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list