Skip to content

关于编译时显示占用的问题 #8494

@wirano

Description

@wirano

观察到 scon 在生成 cmake 工程时使用 size 工具显示工程的占用空间。除了 size 工具外,还可以添加 --gc-sections,--print-memory-usage 选项让 ld 输出占用信息。相比之下使用 --gc-sections,--print-memory-usage 输出的信息更加直观。

请问使用 size 而不是 --gc-sections,--print-memory-usage 是有什么考虑吗(--gc-sections,--print-memory-usage 依赖 bsp 作者添加链接选项,但这应该可以通过脚本在生成工程阶段实现)

   text	   data	    bss	    dec	    hex	filename
  24363	    340	   1344	  26047	   65bf	rtthread.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       24364 B       256 KB      9.29%
            SRAM:        1684 B        32 KB      5.14%

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions