Rtems minimum size problem
joel.sherrill at oarcorp.com
Sat Feb 4 22:43:43 UTC 2006
> I'm using rtems-18.104.22.168 with gcc-4.0.2 and newlib-1.13.0. My striped size of minimum.exe is about 80KB (disable all optimum features); the bss size is about 30KB. But the official document (CPU Supplements) says disable all optimum feature, the code size is about 20KB, and RAM size is about 2KB.
> So, the executive’s ROM and RAM usage is obviously much large than the “RTEMS CPU Applications Supplement” document.
> I wander is there any ways to minimize the code size. How to configure the RTEMS so that the ROM size is about 30KB and RAM size is about 3KB ?
80KB is the size of a fully linked executable. That includes some C
library functionality including reentrant malloc support. It also
includes filesystem infrastructure code. More importantly, it includes
all of the BSP's startup and shutdown code. So the executive proper is
probably still in that range and the other code is technically not part
To shrink it you have to begin by eliminating application requirements
and make sure the BSP isn't pulling in code like printf unintentionally.
Some BSPs have "sticky fingers" and you end up with code in all
configurations that are only required in some. It requires looking at
the symbol table, finding things that you don't know why they are there
and eliminating the reason.
> In fact, the libscore.a is about 80KB in code size, but the bss size is much smaller. Will all the code in libscore.a be linked into the executive? If is so, the minimum will larger than 80KB, is that right?
You are not getting all of libscore.a. Trust me. :)
> Thanks in advance!
> xr at trasin.net
More information about the users