Hey all;
I need to know the memory layout in detail of a c program. Since I have been unable to find out in google the exact things that I want to know I am going to write them here.
Please correct whichever is wrong.
Thanxxx
Assuming a stack going from high to low (From unix book)
---------------- high address
| Environment |
| Variables |
| |
----------------
| |
| Stack |
| | |
| | |
| |
| |
| | |
| | |
| Heap |
----------------
| bss |
| |
| |
---------------- end
| initialised |
| |
| |
---------------- edata
| text |
| |
| |
---------------- low address (etext)
The end , etext and edata are the variables in unix. Now for my questions :)
1) The global variables can lie anywhere after heap ie from end of heap to etext ??
2) What is initialised data ?? Is it the same as int i = 0 in global ??
3) Is there any way to know the start of bss ??
Thanks a lot !! :)