Loads one or several segments at a specific address.
address
A memory address, such as 0x80000400.
- Use LOAD directive to specify an external ROM addr_mode.
- The LOAD directive can be used on all the sections going into ROM.
- The directive is ignored in links if Generate ROM image is not checked in the linker preference panel.
- Inconsistent initialized data sections copied from ROM to RAM may need a reference to a ROM address. For example, to store the .data and .sdata sections in ROM such that they are immediately after the .text section, try the following:
.text LOAD(ADDR(.text)) : {} > rom
.data LOAD(ROMADDR(.text) + SIZEOF(.text)): {} > code
.sdata LOAD(ROMADDR(.data) + SIZEOF(.data)): {} > code