1.17 -frwpi, -fno-rwpi [BETA]

Enables or disables the generation of Read/Write Position-Independent (RWPI) code.


This topic describes a [BETA] feature.


When generating RWPI code, the compiler:
  • Addresses the writable data using offsets from the static base register sb. This means that:
    • The base address of the RW data region can be fixed at runtime.
    • Data can have multiple instances.
    • Data can be, but does not have to be, position-independent.
  • Sets the PI attribute on read/write output sections.


  • This option is independent from -fropi, meaning that these two options can be used individually or together.
  • When using -frwpi, -frwpi-lowering and -fropi-lowering are automatically enabled.


The following restrictions apply:
  • This option is not supported in AArch64 mode.
  • This option is not compatible with -fpic, -fpie, or -fbare-metal-pie options.


The default is -fno-rwpi.
Related reference
1.15 -fropi, -fno-ropi [BETA]
1.16 -fropi-lowering, -fno-ropi-lowering [BETA]
1.18 -frwpi-lowering, -fno-rwpi-lowering [BETA]
Non-ConfidentialPDF file icon PDF versionARM DUI0774E
Copyright © 2014-2016 ARM. All rights reserved.