Remix.run Logo
▲ dvdkon a day ago

> I suspect that hardware without an MMU is not super likely to be able to support XIP.

This seems strange to me. Don't most microcontrollers support executing directly from flash? Some even can't execute from RAM.

Though I agree with the main point, you can compile code as "PIC" - position independent code, and not bother with (ELF) relocations except for linking.

▲ranger_danger a day ago | parent [-]

> Don't most microcontrollers support executing directly from flash?

Yes... I presume they meant XIP for multiple programs at once, since you'd need an MMU for that.

▲dmitrygr a day ago | parent | next [-]

> since you'd need an MMU for that.

Or PIC code... PalmOS 5 & 6 allowed multiple programs in same memory and they were simply compiled pic. MMU was not used

Some architectures (ARM, RISCV, aarch64) are well suited for this kind of code. Others are extremely poorly suited (x86, MIPS), but all CAN do it

▲actionfromafar a day ago | parent | prev [-]

Or the program use relative addressing.