Memo

排查和缩减 Rust 开发的固件体积

排查和缩减 Rust 开发的固件体积 最近在开发 PD sink 工具,一顿操作,终于快要验证完基本功能了,结果 Flash 空间不够用了。构建报错如下: `shell = note: rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 424 bytes ...

排查和缩减 Rust 开发的固件体积

最近在开发 PD sink 工具,一顿操作,终于快要验证完基本功能了,结果 Flash 空间不够用了。构建报错如下:

= note: rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 424 bytes
          rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 504 bytes
          rust-lld: error: section '.gnu.sgstubs' will not fit in region 'FLASH': overflowed by 512 bytes

不得不开始解决这个问题。

固件结构

Flash 占用