Skip to content

clang: add support for ARM FDPIC ABI #146959

Open
@eschaton

Description

@eschaton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:ARMclangClang issues not falling into any other categoryenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions