Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Support for -mno-pic-data-is-text-relative? #158

Open
bradjc opened this issue Jun 5, 2019 · 1 comment
Open

Support for -mno-pic-data-is-text-relative? #158

bradjc opened this issue Jun 5, 2019 · 1 comment

Comments

@bradjc
Copy link

bradjc commented Jun 5, 2019

We're trying to use position independent RISC-V code for an embedded system. Using the various -fPIC options there seems to a reliance on a fixed offset between the RAM and code regions. With ARM, we are using the -mno-pic-data-is-text-relative flag which causes the compiler to use a register as the base for lookups in something like the GOT.

Is there support for this that I am missing? Or anything on the horizon?

More concretely, we are using this for Tock, an embedded operating system where apps can be dynamically loaded, and there is no MMU. Here is our specific cortex-m configuration for GCC.

@aswaterman
Copy link
Contributor

The only existing PIC support requires a fixed offset between the code and static data. It would be nice to define an FDPIC ABI, which would perform static data addressing relative to the global pointer rather than the PC, but no one has taken it upon themselves to specify or implement this yet. It is a big chunk of work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants