Optimizing for size

Vincent Rubiolo vincent.rubiolo@st.com
Sat Aug 30 00:10:00 GMT 2003


Hello to you newlib experts,

I am currently investigating on means to reduce the code size of our project 
that I ported from ADS 1.2 to GNU toolchain with newlib.
The perl scripts I use to report sizes of the different parts show that the 
runtime lib could be one area of such improvements.

I would like to have your feedback concerning the following points :

1. The build of newlib with optimisations for size has no incidence of the 
library size archive (libc.a) at all. The memory usage (we have two memory 
zones, RAM and FLASH) is -192 bytes in FLASH and -12 bytes in RAM (retaken over 
by padding) between the two versions of the library. Can I expect more from the 
size-optimised version of newlib of are these typical memory improvements?

2. Since enabling -fdata-sections and -ffunction-sections flags of gcc along 
with --gc-sections really improved the size of the binary, I was thinking about 
tweaking newlib to build in such a way. After having dug into the source, I see 
that this can be done via C-defines for the mallocr to contain only one function 
each time. Is there any other less painful way of doing this (such as 
-fdata-sections and -ffunction-sections)?

Thank you for your consideration.

Regards,

Vincent



More information about the Newlib mailing list