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
  • 相关阅读:
    请求浏览器使用chrome查看http请求
    输入数据问题一百一十二:C语言合法标识符(2)
    方法调用代理代码改进
    串字符串问题一百一十三:Palindromes _easy version
    删除系统Win7系统盘越来越小,系统盘清理技巧
    配置编译linux下QT程序编译时的错误:QMAKESPEC has not been set, so configuration cannot be deduced.
    整数实例java处理大整数
    触发器课程SQL Server 知识梳理九 触发器的使用
    输出整数回溯法解决素数环
    类注解Spring注解自动注入Bean
  • 原文地址:https://www.cnblogs.com/z3286586/p/14817832.html
Copyright © 2011-2022 走看看