- IAR Embedded Workbench for RISC-V 3.40
- IAR C/C++ Development
- The linker configuration file
- Section handling
- do not initialize directive
do not initialize directive
Syntax
do not initialize {section-selectors} [ except {section-selectors} ];
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 zero-initialized by the system startup code. The directive can only be used on zeroinit sections.
Typically, this is useful if you want to handle zero-initialization in some other way for all or some zeroinit sections.
This can also be useful if you want to suppress zero-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 zero-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 };