User guide

2.6 Read-only position independence
A program is Read-Only Position-Independent (ROPI) if all its read-only segments are position independent.
An ROPI segment is often position-independent code (PIC), but could be read-only data, or a combination of PIC
and read-only data.
Select the ROPI option to avoid committing yourself to having to load your code in a particular location in memory.
This is particularly useful for routines that are:
loaded in response to run-time events
loaded into memory with different combinations of other routines in different circumstances
mapped at different addresses during their execution.
2.6.1 Register usage with ROPI
The usage of registers is the same with or without ROPI (see Register roles and names).
2.6.2 Writing code for ROPI
When you are writing code for ROPI:
Every reference from code in an ROPI segment to a symbol in the same ROPI segment must be pc-relative.
ATPCS does not define any other base register for a read-only segment. An address in an ROPI segment
cannot be stored in an ROPI segment.
Every reference from code in an ROPI segment to a symbol in a different ROPI segment must be pc-relative.
The two segments must be fixed relative to each other.
Every other reference from an ROPI segment must be to either:
an absolute address
an sb-relative reference to writable data (see Read-write position independence).
A read-write word that addresses a symbol in an ROPI segment must be adjusted whenever the ROPI segment
is moved.
Using the Procedure Call Standard
Copyright ?1999 2001 ARM Limited 2-9