2023-06-08 07:33 PM
I found one using IAR for STM32 but the tools are different enough that it is tough to determine how to do things like turn off management of the linker script by the tool. Also, the paper lacks detail regarding how to setup and manage the code.
2023-06-10 07:56 PM
Position independent code IMHO is marginal in MCU because there is no memory management unit as in MPU or CPU. If possible, it won't be optimised code. I assume position independent code means loading the flash binary at different start address, and still have the code running.
2023-06-11 12:53 AM
Position Independent Code has been discussed here some time ago.
If memory serves, the verdict was: not worth it, specifically on small Cortex-M MCUs because the PIC code becomes larger and slower.
The IAR compiler may compensate this by better optimization - that's is why they are still in the business?
> loading the flash binary at different start address
Someone made a proposal in the ideas area, to implement remapping or relocation of internal flash range in the code address space, to make this possible without PIC and MMU.
As Jan W. said - to be safely ignored there...