I have this basic doubt about virtual and physical addresses for ELF section.
objdump -h, shows set of logical and physical address.
$ objdump -h my.elf
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0003c3d0 00080000 00080000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
And as per theory, the LMA(physical address) is also called as load address, and this is the address at which application should be loaded.
All is fine, but my question is why are we assigning physical addresses so early. I mean what if I start a program which mentions some load address, but while loading, system finds that the page frame to which loadable address belong is already assigned to some other task. In that situation, is system going to wait for process or is it going to immediately swap out the page, to make page from available.
Don't you think it would be lot better if we let system to decide at what address to load an elf section based on available page frame.