我正在尝试减小我的 elf 可执行文件的大小。我正在编译-ffunction-sections
-fdata-sections
和链接-gc-sections
,但似乎一些我认为未使用的符号没有被丢弃。
我可以运行 GNU 工具链中的某些命令来找出正在使用哪些符号以及在哪里使用?
- 工具链:GNU arm-none-eabi
- 平台:Cortex-M4
- 语言:C++
这是我典型的构建标志:
汇编: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
关联:arm-none-eabi-g++.exe -static -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wl,-gc-sections -Wl,-T"LinkerScript.ld
谢谢您的帮助。