What do extern and static really do?

Started by
20 comments, last by Some Guy 20 years, 1 month ago
quote:Original post by Some Guy
Okay, what is BSS?


Executable files (whatever they are called on their OS) these days are split up into section (usually .text {=code}, .data and often .bss or .rdata). The .text & .data sections usually have data in them in the exe file which is loaded to particular positions in memory. The BSS section usually has no data associated with it in the file, just a size & location is specified, so when the exe is loaded the OS creates a block of memory for it at the required location of the requisite size and in most OS''s the specification demands that the memory bytes are zero''ed out. As the C & C++ specs say that built-in integer convertable types that are global variables and have no initial value specified are zero, the linker/compiler often place these variables in the bss section.
Advertisement
Oops, missed that question. Thanks, AP
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3

This topic is closed to new replies.

Advertisement