You copied the Doc URL to your clipboard.

-fropi, -fno-ropi

Enables or disables the generation of Read-Only Position-Independent (ROPI) code.


When generating ROPI code, the compiler:

  • Addresses read-only code and data PC-relative.
  • Sets the Position Independent (PI) attribute on read-only output sections.


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


The default is -fno-ropi.


The following restrictions apply:

  • This option is not supported in AArch64 state.
  • This option cannot be used with C++ code.
  • This option is not compatible with -fpic, -fpie, or -fbare-metal-pie options.