- Source: .bss
- Source: BSS
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".
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.
On some platforms, some or all of the bss section is initialized to zeroes. Unix-like systems and Windows initialize the bss section to zero, which can thus be used for C and C++ statically allocated variables that are initialized to all zero bits. Operating systems may use a technique called zero-fill-on-demand to efficiently implement the bss segment. In embedded software, the bss segment is mapped into memory that is initialized to zero by the C run-time system before main() is entered. Some C run-time systems may allow part of the bss segment not to be initialized; C variables must explicitly be placed into that portion of the bss segment.
On some computer architectures, the application binary interface also supports an sbss segment for "small data". Typically, these data items can be accessed using shorter instructions that may only be able to access a certain range of addresses. Architectures supporting thread-local storage might use a tbss section for uninitialized, static data marked as thread-local.
Origin
Historically, BSS (from Block Started by Symbol) is 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 FORTRAN Assembly Program (FAP) and Macro Assembly Program (MAP), IBM's standard assemblers for its 709 and 7090/94 computers. It defined a label (i.e. symbol) and reserved a block of uninitialized space for a given number of words. In this situation BSS served as a shorthand in place of individually reserving a number of separate smaller data locations. Some assemblers support a complementary or alternative directive BES, for Block Ended by Symbol, where the specified symbol corresponds to the end of the reserved block.
BSS in C
In C, statically allocated objects without an explicit initializer are initialized to zero (for arithmetic types) or a null pointer (for pointer types). Implementations of C typically represent zero values and null pointer values using a bit pattern consisting solely of zero-valued bits (despite filling bss with zero is not required by the C standard, all variables in .bss are required to be individually initialized to some sort of zeroes according to Section 6.7.8 of C ISO Standard 9899:1999 or section 6.7.9 for newer standards). Hence, the BSS segment typically includes all uninitialized objects (both variables and constants) declared at file scope (i.e., outside any function) as well as uninitialized static local variables (local variables declared with the static keyword); static local constants must be initialized at declaration, however, as they do not have a separate declaration, and thus are typically not in the BSS section, though they may be implicitly or explicitly initialized to zero. An implementation may also assign statically-allocated variables and constants initialized with a value consisting solely of zero-valued bits to the BSS section.
Peter van der Linden, a C programmer and author, says, "Some people like to remember it as 'Better Save Space'. Since the BSS segment only holds variables that don't have any value yet, it doesn't actually need to store the image of these variables. The size that BSS will require at runtime is recorded in the object file, but BSS (unlike the data segment) doesn't take up any actual space in the object file."
BSS in Fortran
In Fortran, common block variables are allocated in this segment.
Some compilers may, for 64-bit instruction sets, limit offsets, in instructions that access this segment, to 32 bits, limiting its size to 2 GB or 4 GB. Also, note that Fortran does not require static data to be initialized to zero. On those systems where the bss segment is initialized to zero, putting common block variables and other static data into that segment guarantees that it will be zero, but for portability, programmers should not depend on that.
See also
Linker (computing)
Data segment (.data)
Code segment (.text)
Uninitialized variable
References
Stevens, W. Richard (1992). Advanced Programming in the Unix Environment. Addison–Wesley. Section 7.6. ISBN 0-201-56317-7.
BSS may stand for:
Computing and telecommunications
.bss ("Block Started by Symbol"), in compilers and linkers
Base station subsystem, in mobile telephone networks
Basic Service Set, the basic building block of a wireless local area network (WLAN)
Boeing Satellite Systems, see Boeing Satellite Development Center
Blum–Shub–Smale machine, a model of computation
Broadcasting Satellite Service, in television
Broadcasting System of San-in, Japanese TV station broadcast
Business support system, components used by Telecom Service Providers
Entertainment
Best Selling Secrets, a sitcom
BSS 01, a dedicated first-generation home video game console
Brain Salad Surgery, a 1973 Emerson, Lake & Palmer album
Brave Saint Saturn, an American Christian rock band
Broken Social Scene, a Canadian indie rock band
Buraka Som Sistema, an electronic dance music project from Portugal
Beyond Scared Straight, an A&E television series based on the 1978 film Scared Straight!
British Strong Style, a professional wrestling group
BSS, also known as Booseoksoon, a sub-unit of the K-pop group Seventeen
BSS Jane Seymour, a video game
Media
Bangladesh Sangbad Sangstha, the official news agency of Bangladesh
Budavári Schönherz Stúdió, an online television and radio station of BUTE
Medicine
Bismuth subsalicylate, the active ingredient in several medications
Bernard–Soulier syndrome, a bleeding disorder
Bristol stool scale, a medical aid designed to classify the form of human faeces
Balanced salt solution
British Sleep Society, a charity that represents sleep health and sleep medicine
Organizations
Bevara Sverige Svenskt, a Swedish racist movement
Biciklisticki Savez Srbije, the cycling federation of Serbia
Botanical Society of Scotland, the national learning society for botanists of Scotland
Schools
Bayridge Secondary School, Canada
Bayview Secondary School, Canada
Beaconhouse School System, Pakistan
Bishop Strachan School, Canada
Blessed Sacrament School (disambiguation)
Bramalea Secondary School, Canada
Brighton Secondary School, Australia
Bombay Scottish School, Mahim, India
Other uses
Bally Sports South, American regional sports network owned and operated by Bally Sports
British Supersport Championship
Bachelor of Social Science, an academic degree in social science awarded by a university
Bang senseless, a gene of Drosophila melanogaster
Basic Surgical Skills, a mandatory 3-day practical course provided by the Royal College of Surgeons for all trainee surgeons in the UK and Ireland
Baudhayana Shrauta Sutra, a Hindu text
Blind signal separation, a method for the separation of a set of signals in math and statistics
Blue Shirts Society, a Fascist clique and secret police or para-military force in the Republic of China between 1931 and 1938
Broad Street railway station (England)
Broad Street Subway, alternative name for the Broad Street Line, a rapid transit line in Philadelphia
BSS Industrial, a British group of companies in the engineering sector
Kata Kunci Pencarian:
- Lee Seok-min
- Boo Seung-kwan
- Hoshi (penyanyi Korea Selatan)
- Porkas
- USA-243
- Garuda TV Surabaya
- Intelsat 21
- Bahasa Sunda Priangan
- TDRS-11
- Bayar sendiri-sendiri
- .bss
- BSS
- BSS (band)
- BSS Industrial
- OSS/BSS
- Browning BSS
- IEEE 802.11r-2008
- BSS 01
- Base station subsystem
- Fighting (BSS song)