SPRU513Z August 2001 – October 2023 SM320F28335-EP
Using the page method of specifying an address, you can allocate a section into an address space that is named in the MEMORY directive. For example:
MEMORY
{
PAGE 0 : PROG : origin = 0x00000800, length = 0x00240
PAGE 1 : DATA : origin = 0x00000A00, length = 0x02200
PAGE 1 : OVR_MEM : origin = 0x00002D00, length = 0x01000
PAGE 2 : DATA : origin = 0x00000A00, length = 0x02200
PAGE 2 : OVR_MEM : origin = 0x00002D00, length = 0x01000
}
SECTIONS
{
.text: PAGE = 0
.data: PAGE = 2
.cinit: PAGE = 0
.ebss: PAGE = 1
}
In this example, the .text and .cinit sections are allocated to PAGE 0. They are placed anywhere within the bounds of PAGE 0. The .data section is allocated anywhere within the bounds of PAGE 2. The .ebss or .bss section is allocated anywhere within the bounds of PAGE 1.
You can use the page method in conjunction with any of the other methods to restrict an allocation to a specific address space. For example:
.text: load = OVR_MEM PAGE 1
In this example, the .text section is allocated to the named memory range OVR_MEM. There are two named memory ranges called OVR_MEM, however, so you must specify which one is to be used. By adding PAGE 1, you specify the use of the OVR_MEM memory range in address space PAGE 1 rather than in address space PAGE 2. If no PAGE is specified for a section, the linker allocates initialized sections to PAGE 0 and uninitialized sections to PAGE 1.