Executable size

Leon Pollak leonp at plris.com
Thu Dec 24 09:35:51 UTC 2009


Hello.

I removed "-fkeep-inline-functions" - this saved about 20KiB.
I also checked the .en section - it occupies about 70KiB.

All this seems not to describe the 4MiB increasing of text section.

Any hints more?


Thank.

On Wednesday December 23 2009, Thomas Doerfler (nt) wrote:
> Leon,
> 
> just guessing:
> - And RTEMS has been split into many small modules: one module per
> function instead of one module per subsystem. The idea is that the
> linker can then pick in those modules that are required, without unused
> code which in turn would pull in additional unused modules.
> 
> - Many RTEMS functions are implemented as inline functions now, in the
> respective headers files.
> 
> If you compile RTEMS with "-fkeep-inline-functions", then for EACH of
> the many RTEMS modules will carry a local copy of ALL inline-functions
> visible in its header files.
> 
> So you will end up with 100-200 local copies of the inlined functions,
> and this may really bloat the overall executable size.
> 
> So I don't see a reason for the switch "-fkeep-inline-functions" and I
> would guess that it is responsible for your code size increase.
> 
> wkr,
> Thomas.
> 
> Leon Pollak schrieb:
> > Thanks for your responses.
> > Below is the more detailed study.
> >
> > 1. Joel, you are right - the optimized version of application and RTEMS
> > is even a bit smaller (about 5%).
> >
> > 2. Debug version (of application & RTEMS) still is 4 times bigger.
> > This is the 'size' report for 4.8.0:
> >   text    data     bss     dec     hex filename
> > 1093064   20092  298832 1411988  158b94 VDTS
> >
> > And this is the 'size' for 4.9.3:
> >    text    data     bss     dec     hex filename
> > 4050468   14405  298224 4363097  429359 VDTS
> >
> > All the compilation parameters are exactly the same for both cases,
> > except that RTEMS IN BOTH CASES(!) is compiled for debug with:
> > CFLAGS_OPTIMIZE_V=-O0 -g -ggdb -fkeep-inline-functions
> > for optimized with:
> > CFLAGS_OPTIMIZE_V=-O4 -g -ggdb -fno-keep-inline-functions
> >
> > Thanks again.
> 
Leon



More information about the users mailing list