.bss
From Wikipedia, the free encyclopedia
In computer programming, .bss or bss (which originally stood for Block Started by Symbol) 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 (i. e., 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 every variable with an initial value consisting of zero bytes whose extent (i.e. lifetime) is the lifetime of the program. This includes uninitialized global variables , uninitialized file-level static variables, and uninitialized local static variables. Static variables that are initialized to contain only zero bits can also be assigned to the bss section.
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" that in fact is initialized to zero by the C runtime before main () is entered. Some compilers/architectures also 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 addresses.
[edit] See also
[edit] References
- Section 7.6 of Advanced Programming in the Unix Environment by W. Richard Stevens (Addison–Wesley, 1992; ISBN 0-201-56317-7)
[edit] External links
- Unix FAQ section 1.3, where Dennis Ritchie explains the origins of the term "bss"