.bss
From Wikipedia, the free encyclopedia
- "bss" redirects here. For other uses, see BSS.
In computer programming, .bss or bss is used by many compilers and linkers as the name of the data segment containing static variables that are filled solely with zero-valued data initially (ie, when execution begins). It is often referred to as the "bss section" or "bss segment". The program loader initializes the memory allocated for the bss section when it loads the program.
In an object module compiled from C, the bss section contains the local variables (but not functions) that were declared with the static keyword, except for those with non-zero initial values. (In C, static variables are initialized to zero by default.) It also contains the non-local (both extern and static) variables that are also initialized to zero (either explicitly or by default).
Historically, BSS (from Block Started by Symbol) was a pseudo-operation in UA-SAP (United Aircraft Symbolic Assembly Program), the assembler developed in the mid-1950s for the IBM 704 by Roy Nutt, Walter Ramshaw, and others at United Aircraft Corporation.
The BSS keyword was later incorporated into FAP (FORTRAN Assembly Program), IBM's standard assembler for its 709 and 7090/94 computers. It defined a label and reserved uninitialized space for a given number of words.
In embedded software, the BSS segment is mapped into "Uninitialized RAM" which in fact is initialized to zero by the C runtime before main() is entered. Additionally, some compilers/architectures support the SBSS segment for "small data". Typically these data items can be accessed by leaner code using instructions that can only access a certain range of addressses.
[edit] See also
[edit] External links
- Unix FAQ section 1.3, where Dennis Ritchie explains the origins of the term "bss"

