I am trying to reduce the size of the elf executable. I am compiling with -ffunction-sections -fdata-sectionsand linking to -gc-sections, but it seems that some of the characters that I think are not used are not discarded.
Is there any command in the GNU toolchain that I can run to find out which characters are used and where?
- Tool Chain: GNU arm-none-eabi
- Platform: Cortex-M4
- Language: C ++
Here are my typical build flags:
Compilation: arm-none-eabi-g++.exe -Wall -O3 -mthumb -std=c++11 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -fsingle-precision-constant -ffunction-sections -fdata-sections
Link: arm-none-eabi-g++.exe -static -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wl,-gc-sections -Wl,-T"LinkerScript.ld
Thanks for the help.
source
share