The linker places each section in memory based on the attributes of the section and the memory that is available, which is specified by the range command or by default. Each section has the following attributes:
memory type
BASE, RAM, EERAM, REG, SEG, SEGB or ROM (see the .sect directive)
size
absolute
fixed
starting address is specified by the sect command
ranged
memory range is specified by the sect command
Memory is allocated section by section. Typically, there is no way to control the order in which sections are allocated. However, sections are processed in the order in which they become known to the linker. A section is known when it appears in a sect command or is processed in an object module.
Sections are allocated in the following order:
Each absolute or fixed section is placed in memory at its specified address. This includes placing the start section at zero. The memory required for the section must be a part of memory made available through the range command.
Each ranged section is placed in memory within the specified range. This range must lie within a portion of memory specified by the range command.
All remaining sections are allocated as follows: As each section is processed, the ranges for its memory type are examined to find enough free space to allocate the section. Each range is examined in order. The first space large enough to contain the section is used. At this point, the memory allocated is marked "used." If not enough memory is available to allocate the section, an error message is displayed. inpage sections must be placed between address xx00 and xxFE (see assembly .sect directive). For SMALL and MEDIUM memory models, ROM sections must not cross 4K boundaries (see assembly model control and .chip directive).
The load map shows the following information (see Section 3.4 for example):
The Range Definitions show the memory ranges specified by the /RANGE option (Section 3.6.16) or by the default.
The Memory Order Map shows the starting and ending addresses of each contiguous range of memory. It also indicates the type of memory.
The Memory Type Map shows how memory is allocated but is organized by the type of memory. Within each type, the allocation is shown in memory order.
The Total Memory Map shows allocation of all ROM and all RAM.
The Section Table, which is listed by the /NOBRIEFMAP option(see Section 3.6.1), shows each section in the link, along with its starting and ending address. The section attributes are also displayed. The modules that comprise each section are displayed under the section names along with its addresses.
Display of:
Checksum of all ROM bytes
Number of ROM bytes used
Output filename
Memory model
Chip family name
If there is an overlap between sections, this is indicated in the Memory Order Map by the message ** memory overlap ** next to the overlapping section(s).
If sections do not fit in memory, their address is shown in the Section Table as "_ _ _ _ ." Also, no object code is generated for these sections.