当前位置: 首页 > 工具软件 > BSS > 使用案例 >

.bss (the block starting symbol)

蓝恩
2023-12-01

.bss (the block starting symbol)

Wikipedia

The BSS segment contains uninitialized static data, both variables and constants, i.e. global variables and local static variables that are initialized to zero or do not have explicit initialization in source code.
BSS段包含未初始化的静态数据,包括变量和常量,即初始化为零或在源代码中没有显式初始化的全局变量和局部静态变量。
Examples in C include:

static int i;
static char a[12];

In computer programming, the block starting symbol (abbreviated to .bss or bss) is the portion of an object file, executable, or assembly language code that contains statically allocated variables that are declared but have not been assigned a value yet. It is often referred to as the “bss section” or “bss segment”.
在计算机编程中,块开始符号(缩写为.bss或bss)是目标文件、可执行文件或汇编语言代码的一部分,其中包含已声明但尚未赋值的静态分配变量。它通常被称为 “bss section” 或"bss segment"。

Typically only the length of the bss section, but no data, is stored in the object file. The program loader allocates memory for the bss section when it loads the program. By placing variables with no value in the .bss section, instead of the .data or .rodata section which require initial value data, the size of the object file is reduced.
目标文件中通常只存储bss部分的长度,而不存储任何数据。程序加载器在加载程序时为bss段分配内存。通过将无值的变量放在.bss部分,而不是需要初始值数据的.data或.rodata部分,可以减少目标文件的大小。

 类似资料:

相关阅读

相关文章

相关问答