Description
The ARM FDPIC ABI enables the use of ELF shared libraries on MMU-less systems by making global references relative to r9
, which can be useful for higher-end embedded environments including those that support execute-in-place from flash. It also appears that RISC-V and possibly some other processors are adding FDPIC ABIs for similar reasons.
It looks like LLVM has at least partial support for ARM FDPIC in MC and the ELF writer, and that if a target triple resolves to an OS that indicates its ABI is FDPIC that this might be propagated all the way to MC and the ELF writer. However, it’s unclear (to me) whether other aspects of code generation would need to be adjusted to support this, hence this feature request.
GNU toolchains enable FDPIC by passing -mfdpic
to the compiler, so this seems like it would be reasonable for LLVM toolchains as well, in addition to (of course) allowing an OS to specify FDPIC as its ABI when its target triple is resolved.