I am trying to understand how memory allocation works at the different stages of compilation and loading of a program.
1) Compilers and assemblers generate code and data sections that start at address 0.
2) The linker relocates these sections by associating a memory location with each symbol definition, and then modifying all of the references to those symbols so that they point to this memory location.
3) The loader loads the program to main memory, in the context of a process, and
hence it is at this step that paging and all memory management related operations are done.
My question is about two things:
1)How are the addresses assigned by the linker related to the ones assigned by the loader. can we call linker addresses virtual addresses?
2)Do all programs have the same virtual addresses(that are eventually mapped to different physical addresses?)