- IAR Embedded Workbench for Arm 9.70.x
- IAR C/C++ Development
- The linker configuration file
- Declaring the build type
Declaring the build type
Declaring the build type in the linker configuration files specifies to the linker whether the build is for a traditional ROM system (with, among other things, variable initialization at program start) or for a RAM system to be used for debugging (where other styles of initialization can be used).
build for directive
Syntax
build for { ram | rom };
Parameters
| The build is assumed to be a debugging or experimental setup, where some or all variable initialization can be performed at load time. |
| The build is assumed to be a traditional ROM build, where all variable initialization is performed at program start. |
Description
If you declare a build type of rom—and especially if you also declare which memory regions are ROM or RAM—the linker can perform better checking that only suitable sections are placed in the different memory regions. If you do not explicitly specify an initialize directive (see initialize directive), the linker will behave as if you had specified initialize by copy { rw };.
If you declare a build type of ram, the linker does not check which section types are placed in which memory region.
If you do not include the build for directive in the linker configuration file, the linker only performs limited checking. This is useful primarily for backward compatibility purposes.