|
|||||||||||||||||||
|
Technical Support On-Line Manuals Linker User Guide |
Placement of sections with overlays
You can use the The following example shows the definition of a static section in RAM followed by a series of overlays. Here, only one of these sections is instantiated at a time. Example 28. Specifying a root region
EMB_APP 0x8000
{
.
.
STATIC_RAM 0x0 ; contains most of the RW and ZI code/data
{
* (+RW,+ZI)
}
OVERLAY_A_RAM 0x1000 OVERLAY ; start address of overlay...
{
module1.o (+RW,+ZI)
}
OVERLAY_B_RAM 0x1000 OVERLAY
{
module2.o (+RW,+ZI)
}
... ; rest of scatter-loading description...
}
A region marked as The linker defined symbols can be used to obtain the addresses required to copy the code and data. The An overlay region can have a relative base. The behavior of
an overlay region with a When a
The following table shows the effect of Table 16. Using relative offset in overlays
The following example shows the use of relative offsets with overlays and the effect on execution region addresses: Example 29. Example of relative offset in overlays
EMB_APP 0x8000{
CODE 0x8000
{
*(+RO)
}
# REGION1 Base = CODE limit
REGION1 +0 OVERLAY
{
module1.o(*)
}
# REGION2 Base = REGION1 Base
REGION2 +0 OVERLAY
{
module2.o(*)
}
# REGION3 Base = REGION2 Base = REGION1 Base
REGION3 +0 OVERLAY
{
module3.o(*)
}
# REGION4 Base = REGION3 Limit + 4
Region4 +4 OVERLAY
{
module4.o(*)
}
}
If the length of the non-overlay area is unknown, a zero relative offset can be used to specify the start address of an overlay so that it is placed immediately after the end of the static section. You can use the following command-line options to add extra debug information to the image:
These permit an overlay-aware debugger to track which overlay is currently active.
| ||||||||||||||||||
|
|||||||||||||||||||