Skip to main content

IAR Embedded Workbench for Arm 9.70.x

‑‑ropi

In this section:
Syntax

‑‑ropi=[pc|cb]

Parameters

pc (default)

The compiler uses PC-relative references to address code and read-only data.

cb

The compiler uses offsets relative to the constant base register (R8). This corresponds to using ‑‑ropi together with ‑‑ropi_cb.

Description

Use this option to select which method the compiler uses for position-independent accesses to read-only data. In 64-bit mode, this option is not available.

When this option is used, these limitations apply:

  • C++ constructions cannot be used

  • The object attribute __ramfunc cannot be used

  • Pointer constants cannot be initialized with the address of another constant, a string literal, or a function. However, writable variables can be initialized to constant addresses at runtime.

Consider using movable blocks in the linker configuration file. See define block directive.

See also

‑‑no_rw_dynamic_init, and Description of predefined preprocessor symbols.

Caution

Project>Options>C/C++ Compiler>Code>Code and read-only data (ropi)