In the programming, excution file (.exe or .bin) is consist of below structure.
1. Text (code) segment
2. Data segment
2.1 Initialized Data
2.1.1 Initialized read only Data
2.1.2 Initialized read/write Data
2.2 Uninitialized (bss: Block Started by Symbol)
3. Heap segment (in the run time, size is decided)
Dynamic allocated variables
4. Stack segment (in the compile time, size is decided)
Automatically allocated variables (local variables) and other stack frame entries
Binary or Excution file is "Text + Initialized Segment".
Graphically description is
/-------------------------/ High Address (Memory Address)
| |
| Stack |
| |
/-------------------------/
| |
| Heap |
| |
/-------------------------/
| Uninitialized data |
| ---------Data---------- |
| Initialized data |
/-------------------------/
| |
| Text |
| |
/-------------------------/ Low Address (Memory Address)
http://kldp.org/node/199#comment-461
Data Segment
BSS
Wednesday, October 21, 2009
stack, heap, and bss ...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment