This is the mail archive of the crossgcc@sources.redhat.com 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: elf size


On Thu, Mar 14, 2002 at 02:54:53PM -0700, Jibin Han wrote:
> 	I just built an ELF format executible by linking hello_world.o,
> bsp archive and libc. The file size is around 300k even I use -o3 in
> compile option.
> 	hello_world.c is trivial.
> 	Someone else ported libc for powerpc eabi, and it seems no
> problem.
> 	The stuff I can hack is makefiles, link script and the hooking up
> code. But it's really hard for me to figure out the problem.

the problem is that your hello_world executable is 300k, correct?

> 	so from your experience, what might be the possible problem?

you are calling printf, which references other code which must then be
linked in from libc.

> Is there any tool to help debuging that?

add -t to the linker to show all the library members which are being
pulled in from libc.

look at the symbols in your executable with nm and follow the
references.

also if you have a floating point unit (FPU) on your powerpc, make sure
you are compiling against a non FPU-emulated libc library -- it is
possible you are pulling in FPU emulation libraries.

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron@frye.com
     "In a few thousand years people will be scratching their heads
       wondering how on earth the first computer was invented and
          bootstrapped without a prior computer to do it with."
                    --  Chris Malcolm, on comp.arch

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


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