Pretty sure with xtensa and gcc you can compile to PIC. Google says a linker only would need to modify the Global Offset Table and Procedure Linkage Table. That doesn't sound too terrible.

Also 260kB of RAM on a 32bit processor could be a fair bit of code. Plus you could write it to external or internal flash. Though I don't know if esp-idf supports XIP (Zephyr does).

> esp-idf supports XIP

XIP depends on hardware support, not software.