I'm trying to wrap my head around the way program memory is allocated at run-time and the different sections or "segments" of a program (if that is the right word). I'm almost there, but not quite and could use a little help.
I know that the program contains a .data section, with both read only and read-write memory for initialized global variables. I know that the .bss section is used for uninitialized global and static variables and is read-write. I understand the heap and the stack.
The following questions illustrate my confusion:
- What is the .rodata section and where does it exist?
- How does the .data? section in MASM differ from the .data section?
- Does every program have to have the standard .data, .bss, .code sections, or are these conventions just guidelines?
- What determines which sections are readable, writable, and executable?
Any help would be greatly appreciated.