Skip to main content

IAR Embedded Workbench for Arm 9.70.x

‑‑rwpi

In this section:
Syntax

‑‑rwpi=[sb|sb_near|got]

Parameters

sb (default)

The compiler uses offsets relative to the static base register (R9).

sb_near

The compiler uses offsets relative to the static base register (R9), with a restricted range (64 Kbytes). This corresponds to using ‑‑rwpi_near.

got

The compiler uses offsets relative to the global offset table (GOT). This setting is used when generating code for shared objects. Because this behavior is set implicitly by the option ‑‑shared, there is no need for setting this explicitly.

Description

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

When this option is used, these limitations apply:

  • The object attribute __ramfunc cannot be used

  • Pointer constants cannot be initialized with the address of a writable variable. However, static writable variables can be initialized to writable 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>Read/write data (rwpi)