| __ld_omit_bss_init

Previous | Symbols to Control the Linker | Next

Defining this symbol in a source file tells the linker that this file does not depend on the initialization of the BSS section to zero. The result is that all uninitialized global variables defined in that file may contain garbage at the beginning of the program. This does not guarantee that the initialization is skipped; in fact, if at least one file needs the initialization, it is easier to initialize even the variables that were declared to not need it.
For pointer-based object file formats (such as COFF, the format used by the GNU tools included in TIGCC), this symbol really affects all variables in the file it is defined in. For sequential formats (such as the AmigaOS format used by the A68k assembler), it affects only the parts that follow the symbol. Since BSS data usually appears at the end of the object file, this restriction should not have any effect.
Note: If you define this symbol, you should use the compiler option '-fno-zero-initialized-in-bss'; otherwise even variables explicitly initialized to zero will contain garbage.