This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: crosstool-generated toolchain produces massive ELF executable


Robert P. J. Day said the following on 01/30/2006 11:18 AM:
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 400K?

i realize newlib is a more lightweight C library but it still doesn't
make a whole lot of sense to me. yet.
Glibc might have a longer list of dependencies for functions than newlib. There could be a bug in the linker scripts generated for your toolchain which is adding bogus bits
which does not happen on newlib based toolchain. Essentially ld uses different scripts for linking. I dont
suspect gcc to be generating different code. It definitely has to do with linking.
rday


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.org


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