builtin lib make executable file bigger
Hi STworld:
There are some functions in builtin lib that I don’t use but they takes about 10KB in my executable bin file. They are
function size(hex) size(dec)
_dtoa_r 0xea8 3752
_malloc_r 0x524 1316
_realloc_r 0x3ec 1004
_svfprintf_r 0x14d0 5328
I see them in output.map as functions in libc.a.
If I don’t use them, can I remove them out from my bin file? And how to do that?
By the way, I am uisng STM32F427ZI on AC6 IDE. Additional, I check on -ffunction-sections and -fdata-sections for MCU GCC Compiler. I also discard unused section (-WI,-gc-sections)
in linkerscript.ld file, I see the section:
DISCARD :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
I try to remove that section but isn’t successfull to reduce my bin file size.
Everyone, please help.
Best regards,
Hung Phan