1.38 -mexecute-only

Generates execute-only code, and prevents the compiler from generating any data accesses to code sections.

To keep code and data in separate sections, the compiler disables literal pools and branch tables when using the -mexecute-only option.


Execute-only code must be Thumb code.
Execute-only code is only supported for:
  • Processors that support the ARMv8-M.baseline or ARMv8-M.mainline architecture.
  • Processors that support the ARMv7-M architecture, such as the Cortex-M3.
If your application calls library functions, the library objects included in the image are not execute-only compliant. You must ensure these objects are not assigned to an execute-only memory region.


ARM does not provide libraries that are built without literal pools. The libraries still use literal pools, even when you use the -mexecute-only option.
Related information
Building applications for execute-only memory
Non-ConfidentialPDF file icon PDF versionARM DUI0774E
Copyright © 2014-2016 ARM. All rights reserved.