Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikipedia

.bss

Reference material by Wikipedia contributors. This retains its source identity and is not 411 news reporting.

Code section for declared statically-allocated variables a Basic Service Set (BSS) in a Wi-Fi LAN Service set (802.11 network)#Basic service sets (BSSs) 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.McKusick Marshall Kirk Marshall Kirk McKusick Karels Michael J. Michael J. Karels 1986 A New Virtual Memory Implementation for Berkeley UNIX University of California, Berkeley http://www.mimuw.edu.pl/~janowski/VMpapers/newvm.pdf 3 March 19, 2026 https://web.archive.org/web/20260319160214/https://www.mimuw.edu.pl/~janowski/VMpapers/newvm.pdf 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.http://www.nongnu.org/avr-libc/user-manual/mem_sections.html Memory Sections AVR Libc Home page 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.https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/specialsections.html ELF Special Sections Linux Standard Base PDA Specification 3.0RC1 Origin thumb|383x383px|This shows the typical layout of a simple computer's program memory with the text, various data, and stack and heap sections. 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.Network Dictionary. Javvin Press, 2007, p. 70.Coding for the MIT-IBM 704 Computer October 1957, p. V-10 The BSS keyword was later incorporated into FORTRAN Assembly Program FORTRAN ASSEMBLY PROGRAM (FAP) for the IBM 709/7090 J28-6098-1 1961 https://archive.computerhistory.org/resources/text/Fortran/102663110.05.01.acc.pdf 18 October 2017 30 IBM (FAP) and Macro Assembly Program IBM 7090/7094 IBSYS Operating System Version 13 Macro Assembly Program (MAP) Language C28-6392-4 1963 https://bitsavers.org/pdf/ibm/7090/C28-6392-4_MAP_Dec66.pdf IBM (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.Ted Timar 1996 Unix - Frequently Asked Questions (1/7) http://www.faqs.org/faqs/unix-faq/faq/part1/section-3.html Question 1.3 etal 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.Free Software Foundation, Inc. 38.9. Directives http://linux.web.cern.ch/linux/scientific4/docs/rhel-as-en-4/tic54x-directives.html Using as: Using as, the Gnu Assembler Feb 22, 2014 March 19, 2014 https://web.archive.org/web/20140319004008/http://linux.web.cern.ch/linux/scientific4/docs/rhel-as-en-4/tic54x-directives.html dead 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."Peter van der Linden, Expert C Programming: Deep C Secrets, Prentice Hall 1994, p. 141 BSS in Fortran In Fortran, common block variables are allocated in this segment.How does Fortran 77 allocate common-block variables? 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.https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/RS_002f6000-and-PowerPC-Options.html#RS_002f6000-and-PowerPC-Options IBM RS/6000 and PowerPC Options Using the GNU Compiler Collection (GCC) GCC 7.2.0https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/SPARC-Options.html#SPARC-Options SPARC Options Using the GNU Compiler Collection (GCC) GCC 7.2.0https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/x86-Options.html#x86-Options x86 Options Using the GNU Compiler Collection (GCC) GCC 7.2.0 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 W. Richard Stevens 1992 Advanced Programming in the Unix Environment Addison–Wesley Section 7.6 0-201-56317-7 registration https://archive.org/details/advancedprogramm00stev/page/ Category:Executable file formats Category:Memory management Assembly language Category:Programming language implementation