【发布时间】:2014-07-09 09:06:27
【问题描述】:
我正在尝试减小我的 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
感谢您的帮助。
【问题讨论】: