Skip to main content

IAR Embedded Workbench for Arm 9.70.x

‑‑section_prefix

In this section:
Syntax
‑‑section_prefix=prefix
Description

The compiler places functions and data objects into named sections which are referred to by the IAR ILINK Linker. Use this option to change the name of sections that are not explicitly named using the @ notation or the #pragma location directive.

This option creates section names by putting a prefix before the default name for the section type. This makes it possible to use different section-selectors for different purposes. You can use tcm.* in the example below to match the prefix or, for example, *.bss to match sections with zero-initialized data.

Note

Any changes to the section names require corresponding modifications in the linker configuration file.

Example

Specifying ‑‑section_prefix=tcm places:

  • code in tcm.text instead of .text

  • read-only data in tcm.rodata instead of .rodata

  • zero-initialized data in tcm.bss instead of .bss

  • other initialized data in tcm.data instead of .data

See also

Controlling data and function placement in memory.

Caution

To set this option, use Project>Options>C/C++ Compiler>Extra Options.