Quantcast
Channel: How is ELF entry point address handled on systems without virtual memory? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by user3124812 for How is ELF entry point address handled on systems without virtual memory?

$
0
0

Short story, it does not handled anyhow.

And now there is a long story.

ELF is not executable as is, it's sort of container with executable data. In systems with OS and MMU, OS creates a process and respective MMU page tables for that process. After that read ELF and copy executable code and data sections (BSS) into this newly allocated process memory according to data in ELF file. Once that done, program counter is set to entry point address. You program runs. Hooray.

Important point to highlight is that every process has it's own virtual memory which is mapped into unique physical memory. So virtual addresses could overlap or be the same for different processes, while physical addresses are always different at any given moment.

Now there is a system without MMU. So there is no virtual memory, every process should be placed in unique physical memory region and linked to that precise memory region.

In real life if there is some small system w/o MMU ELF files simply not used. Option 1, all apps linked together into one big binary. Option 2, apps linked separately with unique addresses, executable information is extracted with some 'objcopy' util, and that binaries copied into system for execution. 'OS' should have a list of entry point to start these 'processes'.


Viewing all articles
Browse latest Browse all 2

Trending Articles