Placing a section at a specific address in memory
To place a section at a specific address in memory, use the place at directive, for
example:
/* Place section .vectors at address 0 */
place at address Mem:[0] {readonly section .vectors};
Placing a section first or last in a region
To place a section first or last in a region is similar, for example:
/* Place section .vectors at start of ROM */
place at start of ROM {readonly section .vectors};
Declare and place your own sections
To declare new sections!ain addition to theones used by the IAR build tools!ato hold
specific parts of your code or data, use mechanisms in the compiler and assembler. For
example:
/* Places a variable in your own section MyOwnSection. */
const int MyVariable @ "MyOwnSection" = 5;
name createSection
/* Create a section */
section myOwnSection:CONST
/* And fill it with constant bytes */
dcb 5, 6, 7, 8
end
To place your new section, the original place in ROM {readonly}; directive is
sufficient.
However, to place the section MyOwnSection explicitly, update the linker configuratio
file with a
place in directive, for example:
/* Place MyOwnSection in the ROM region */
place in ROM {readonly section MyOwnSection};