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
  • 相关阅读:
    SharePoint 2010 与RMS集成方案
    VBS基础教程
    c#中csc命令的用法
    文本文件编码格式转换
    “本地连接”属性中“身份验证”选项卡消失的处理方法
    如何组建中小型SharePoint服务器场
    PHP文件上传详解
    Flash AS3 RadioButton的使用方法
    SUSE ssh登录慢解决办法,ssh登录失败,但是strace一下就好了的分析查询 第一次ssh,路由的问题
    AS3组件之ComboBox下拉框
  • 原文地址:https://www.cnblogs.com/z3286586/p/14817832.html
Copyright © 2011-2022 走看看