crosstool-generated toolchain produces massive ELF executable

Robert P. J. Day
Mon Jan 30 19:19:00 GMT 2006

On Mon, 30 Jan 2006, Khem Raj wrote:

> Robert P. J. Day said the following on 01/30/2006 07:25 AM:
> >   when i use a crosstool-generated toolchain, the executable turns out
> > to be almost 400K in size.  that executable is created by linking all
> > of the object files with the static libs libc.a and libgcc.a, and the
> > difference seems to be that the KPIT toolchain only links in those
> > routines that are used, but the crosstool toolchain pulls in all kinds
> > of unnecessary library routines, thus creating that overly-large final
> > executable.
> >
> is the version of binutils same? ld might be doing a better job of
> unreferenced section removal in KPIT there has been recent work done
> in ld in this area. Secondly you may inspect the linker map file to
> check which sections are adding to size. It might be some tweak
> needed in linker script file.

i'll look more closely this afternoon.  i'm guessing it's because the
KPIT toolchain uses newlib and not glibc, but i still don't see why
that would make that kind of difference.  i mean, from 80K to almost

i realize newlib is a more lightweight C library but it still doesn't
make a whole lot of sense to me.  yet.


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

More information about the crossgcc mailing list