- IAR Embedded Workbench for RH850 3.20.x
- IAR C/C++ Development
- The linker configuration file
- Section handling
- do not initialize directive
do not initialize directive
Syntax
[force] do not initialize {section-selectors} [ except {section-selectors} ];
Modifiers
| Forces the sections to be uninitialized regardless of their initialization content. |
For information about section selectors and except clauses, see Section selection.
Description
Use the do not initialize directive to specify the sections that you do not want to be automatically initialized by the system startup code.
Without the force modifier, the directive can only be used on zeroinit sections and has no effect on matching sections that are not zero-initialized. To force a section to be uninitialized regardless of its initialization content, specify force do not initialize.
Typically, this directive is useful if you want to handle initialization in some other way for all or some sections. This can also be useful if you want to suppress initialization of variables entirely. Normally, this is handled automatically for variables specified as __no_init in the source, but if you link with object files produced by older tools from IAR or other tool vendors, you might need to suppress initialization specifically for some sections.
Example
/* Do not initialize read-write sections whose name ends with _noinit at program start */
do not initialize { rw section .*_noinit };
place in RAM { rw section .*_noinit };