7.60 --execute_only

Generates execute-only code by adding the EXECONLY attribute to the AREA directive for all code sections, preventing 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. That is, specifying --execute_only implicitly specifies the following compiler options:
  • --no_integer_literal_pools.
  • --no_float_literal_pools.
  • --no_string_literal_pools.
  • --no_branch_tables.


Execute-only code must be Thumb code.
Execute-only code is only supported for:
  • Processors that support the ARMv7-M architecture, such as Cortex-M3, Cortex-M4, and Cortex-M7.
  • Processors that support the ARMv6-M architecture.


    ARM has only performed limited testing of execute-only code on ARMv6-M targets.
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 various --no_*_literal_pools options.
Related concepts
3.19 Compiler support for literal pools
Related reference
7.83 --integer_literal_pools, --no_integer_literal_pools
7.153 --string_literal_pools, --no_string_literal_pools
7.14 --branch_tables, --no_branch_tables
7.63 --float_literal_pools, --no_float_literal_pools
Related information
AREA (assembler directive)
Building applications for execute-only memory
Non-ConfidentialPDF file icon PDF versionARM DUI0375G
Copyright © 2007, 2008, 2011, 2012, 2014, 2015 ARM. All rights reserved.