cross-compiled program size is too big,
Posted: Tue Aug 19, 2008 4:27 am
I am using Ubuntu 7.10. By following the OS specific tool chain, I make a cross compiler
together with newlib. I provided a few stubs in syscalls.c which are as simple as one
statement "return -1;"
However, a simple cross compiled program using this cross gcc is 119213 bytes while
the program compiled by the normal gcc installed together with Ubuntu 7.10 is only 6451bytes.
By checking the disassembled code I found unused stubs were also integrated in the
program. Other major size-contributors are <__sprint_r> and <_dtoa_r> which should comes
from newlib.
Is there a way to reduce the cross-compiled program size?
together with newlib. I provided a few stubs in syscalls.c which are as simple as one
statement "return -1;"
However, a simple cross compiled program using this cross gcc is 119213 bytes while
the program compiled by the normal gcc installed together with Ubuntu 7.10 is only 6451bytes.
By checking the disassembled code I found unused stubs were also integrated in the
program. Other major size-contributors are <__sprint_r> and <_dtoa_r> which should comes
from newlib.
Is there a way to reduce the cross-compiled program size?