News for hackers. Stuff that matters.
Re:Oasis: a small statically-linked Linux system by robocat on Tuesday December 01, 2020 @04:09PM (#25269926)
It was for personal operating systems (and ancient mainframes) that had a multitasking OS but without any MMU support in the hardware. Relocatable executables were required so that you could load multiple executables at different addresses within the single address space of the memory. This is now called Position Independent Code[1].

Modern MMUs meant that the OS would define specific addresses for use by a program, so for example all ELF programs in a distribution would have the same starting address in memory hard coded into the executable (one virtual address within a process is mapped to a different physical memory address for each process by the MMU).

[1] https://en.wikipedia.org/wiki/Position-independent_code

Re:Oasis: a small statically-linked Linux system by Someone on Tuesday December 01, 2020 @05:39PM (#25271005)
There’s a difference. Position independent means you can move the executable anywhere and run it.

Relocatable means the binary has enough information to fix any absolute addresses in the code after that move. That’s extra work, and means you cannot have the same physical memory mapped to different virtual addresses in different processes, and that you have to either swap out the relocated memory, or repeat the relocation when you swap in the code again (I’m not aware of any OS doing the latter, and don’t see a nice way to do it, but it is a possibility).

https://en.wikipedia.org/wiki/Position-independent_code:

“In computing, position-independent code[1] (PIC[1]) or position-independent executable (PIE)[2] is a body of machine code that, being placed somewhere in the primary memory, executes properly regardless of its absolute address.”

https://en.wikipedia.org/wiki/Relocation_(computing):

“Relocation is the process of assigning load addresses for position-dependent code and data of a program and adjusting the code and data to reflect the assigned addresses.”