Binary is twice bigger

Leon Pollak leonp at
Tue Dec 23 11:41:11 UTC 2003

On Tuesday 23 December 2003 12:24, you wrote:
> > 	Some time ago I ported one of my applications from RTEMS version 4.0.3
> > (also ported to CodeWarrior in Windows) to RTEMS 4.6 (pre-last snapshot)
> > in Linux. I used the basic configuration (without networking) with
> > miniIMFS with RTEMS API and without any other options (I hope so). I want
> > to remind, that 4.0.3 RTEMS version was a "pure" kernel version yet,
> > without IMFS and Co. As the result, I can compare the size of working
> > binary in this 2 cases (both without optimizations).
> > 	The size of Windows/CodeWarrior version is 173KB. The size of GDB/Linux
> > version is 349KB - twice bigger!!!
> GDB/Linux? What do you mean by this?
Oh, sorry, typo error - GCC/Linux

> Anyway, I'll presume you mean the size of RTEMS executables.
Yes, I mean those I receive after "objcopy -R .comment -S"

> Which compilers? Which target?
Oh, again sorry! Target is MPC860.
RTEMS 4.0.3 version was compiled by CodeWarrior 4 without optimizations.
RTEMS 4.6 is compiled by last gnu tool chain from the OAR site.

> Which options? What happens if you turn on optimization (the sizes gcc
> produces can vary extremely between optimization levels. I've seen
> factor 2-4 with the sh1.)
O'K, I tested this now. After removing -g and adding -O3 the binary size 
became 306KB. Still very big!

> Which language? Esp. C++ has changed significantly between gcc-versions
> and can produce large binaries.
95% of the application is written in pure C. 5% in  "EC++", I mean no 
exceptions, no virtual functions, etc..
And this is the same for both 4.0.3 and 4.6 versions.

> > 	I am very interested in comments of gurus on the item. Thanks ahead.
> What exactly did you compare (Which binaries)?
I am in doubt if I do understand the question...:-(
Binaries are those I burn into flashes to run the unit. What do you mean?

> The only figures that matter are the sizes of the sections being applied
> inside of a download image not the size of the files.
O'K, you are right. Now, I looked into map file of gcc built application - the 
pure .text section (without any additional things like .gnu_linkonce, 
.rodata, etc.) is already 266KB size, which is 93KB greater!

> And ... you could try to apply objdump, gcc  -Wl,-Map etc. to find out
> what actually has increased.
See above.

> Lots of questions, I know, but without knowing the details, probably
> nobody will be able to answer nor to help.
Thanks for your effort to answer. I hope my answers clarify a bit my case.
Thanks again.

> Merry Christmas,
> 	Ralf

Happy new year,

More information about the users mailing list