SPRUI03E June 2015 – January 2023
The load address determines where a loader places the raw data for the section. Any references to the section (such as labels in it) refer to its run address. See Section 4.2.1 for an overview of load and run addresses.
If you provide only one allocation (either load or run) for a section, the section is allocated only once and loads and runs at the same address. If you provide both allocations, the section is allocated as if it were two sections of the same size. This means that both allocations occupy space in the memory map and cannot overlay each other or other sections. (The UNION directive provides a way to overlay sections; see Section 9.6.7.2.)
If either the load or run address has additional parameters, such as alignment or blocking, list them after the appropriate keyword. Everything related to allocation after the keyword load affects the load address until the keyword run is seen, after which, everything affects the run address. The load and run allocations are completely independent, so any qualification of one (such as alignment) has no effect on the other. You can also specify run first, then load. Use parentheses to improve readability.
The examples that follow specify load and run addresses.
In this example, align applies only to load:
.data: load = SLOW_MEM, align = 32, run = FAST_MEM
The following example uses parentheses, but has effects that are identical to the previous example:
.data: load = (SLOW_MEM align 32), run = FAST_MEM
The following example aligns FAST_MEM to 32 bits for run allocations and aligns all load allocations to 16 bits:
.data: run = FAST_MEM, align 32, load = align 16
For more information on run-time relocation see Section 4.6.