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
  • 相关阅读:
    Java 8 stream的详细用法
    SpringBoot启动异常 Process finished with exit code 1
    GIT-版本管理-初阶使用
    升级 kubeadm 集群
    antdv 获取 axios文件上传实时进度
    Ant Design Vue 实现文件上传 (通过点击提交按钮后开始上传)
    Ant Design Vue 实现菜单栏根据url变化自动高亮和展开
    Do not access Object.prototype method 'hasOwnProperty' from target object
    Nginx配置WebSocket (包含nginx-ingress-controller)
    Django ORM 常用字段和参数/关系字段/ForeignKey操作/数据库查询优化(重要)/事务初识
  • 原文地址:https://www.cnblogs.com/z3286586/p/14817832.html
Copyright © 2011-2022 走看看