zoukankan      html  css  js  c++  java
  • text data bss dec 代表的含义

    Invoking: Print Size
    tc32-elf-size -t tl_zigbee_switch_k4.elf
       text	   data	    bss	    dec	    hex	filename
     195984	    576	  20200	 216760	  34eb8	tl_zigbee_switch_k4.elf
     195984	    576	  20200	 216760	  34eb8	(TOTALS)
    Finished building: sizedummy
    

      

    在stm32中flash就是ROM,掉电数据不会丢失;(通常保存着text段、Code、Ro-data、Rw-data)

    RAM就是运行内存,掉电数据就丢失;(通常保存着堆、栈、bss段、data段、ZI-data、RW-data)

    一.text

    ‘text’ is what ends up in FLASH memory. I can show this with adding

    text段最终是存放在FLASH存储器中的。通过增加如下代码到程序中:

    void foo(void) {
    
      /* dummy function to show how this adds to 'text' */
    
    }
       text	   data	    bss	    dec	    hex	filename
     195995	    576	  20200	 216760	  34eb8	tl_zigbee_switch_k4.elf
    

    但text段不仅包含函数,还有常量。例如我有如下的一个常量表:

    const int table[] = {5,0,1,5,6,7,9,10};
     
    二.data

    ‘data’ is used for initialized data. This is best explained with the following (global/extern) variable:

    data段是用于初始化数据。用如下的变量(全局/外部)可以解释得很清楚:

    int32_t myVar = 0x12345678;

    Adding above variable to my application will increase the ‘data’ portion by 4 bytes:

    加入上述变量会导致我的应用的data部分增长四个字节:

       text	   data	    bss	    dec	    hex	filename
     195995	    580	  20200	 216760	  34eb8	tl_zigbee_switch_k4.elf
    
    

    三.bss

    The ‘bss’ contains all the uninitalized data.

    bss段包含着所有未初始化的数据。

    bss (or .bss, or BSS) is the abbreviation for ‘Block Started by Symbol’ by an old assembler (see this link).

    bss(.bss, BSS ) 是旧式汇编器中‘Block Started by Symbol’的简称(详情参看 link)。

    This is best explained with following (global/extern) variable:

    用如下的变量(全局/外部)可以解释得很清楚:

    int32_t myGlobal;

    Adding this variable will increase the ‘bss’ portion by 4:

    加入上述变量会导致bss部分增长4个字节:

      text	   data	    bss	    dec	    hex	filename
     195995	    580	  20204	 216760	  34eb8	tl_zigbee_switch_k4.elf

    dec

    The ‘dec’ (as a decimal number) is the sum of text, data and bss:

    dec(decimal的缩写,即十进制数)是text,data和bss的算术和。

    dec = text + data + bss
  • 相关阅读:
    eclipse配置spring4.0环境详细教程
    PostgreSQL精简命令:
    Unity3D项目之 Survival Shooter 记录
    Unity UGUI 实现简单拖拽功能
    Unity UGUI实现Button按钮长按状态的判断
    Unity获取文件夹下指定类型的文件数量
    Unity5 AssetBundle打包加载及服务器加载
    Unity5.X 新版AssetBundle打包控制
    Unity基于DFGUI的TreeView设计
    Unity5.X 新版AssetBundle使用方案及策略
  • 原文地址:https://www.cnblogs.com/z3286586/p/14817832.html
Copyright © 2011-2022 走看看