|
|||||||||||
|
Technical Support On-Line Manuals Linker User Guide |
Linker User GuideSection placement with the linker
By default, the linker places input sections in the following order when generating an image:
Portions of the image are collected together into a minimum number of contiguous regions. NoteThe sorting order is unaffected by ordering within scatter files or object file names. These rules mean that the positions of input sections with identical attributes and names included from libraries is not predictable. If you require more precise positioning, specify the individual modules explicitly in a scatter file, and include the modules in the input file list for the armlink command. The base address of each input section is determined by the sorting order defined by the linker, and is correctly aligned within the output section that contains it. By default, the linker creates an image consisting of an RO output section, an RW output section, and optionally a ZI output section. The RO output section can be protected at run-time on systems that have memory management hardware. RO sections can also be placed into ROM in the target. Alternative sorting orders are available with the The linker might not be able to place some input sections in any execution region. When this happens, the linker generates an error message. This might occur because your current scatter file does not permit all possible module select patterns and input section selectors. How you fix this depends on the importance of placing these sections correctly:
When the linker creates an input section for each ELF section in the input objects, it increments a global counter. The value of this counter is stored in the section as the creation index. The creation index is used when placing any unassigned sections that have identical properties. The following scatter file shows how the linker places sections:
LoadRegion 0x8000
{
ExecRegion1 0x0000 0x4000
{
*(sections)
*(moresections)
}
ExecRegion2 0x4000 0x2000
{
*(evenmoresections)
}
}
The order of execution regions within the load region is not altered by the linker.
| ||||||||||
|
|||||||||||