| |||
| Home > Formal syntax of the scatter file > Example of aligning a base address in execution space but still tightly packed in load space | |||
This example uses a combination of pre-processor macros and
expressions to copy tightly packed execution regions to execution
addresses in a page-boundary. Using the ALIGN scatter-loading
keyword aligns the load addresses of ER2 and ER3 as
well as the execution addresses
Example 13. Aligning a base address in execution space but still tightly packed in load space
#! armcc -E
#DEFINE START_ADDRESS 0x100000
#DEFINE PAGE_ALIGNMENT 0x100000
LR1 0x8000
{
ER0 +0
{
*(InRoot$$Sections)
}
ER1 START_ADDRESS
{
file1.o(*)
}
ER2 AlignExpr(ImageLimit(ER1), PAGE_ALIGNMENT)
{
file2.o(*)
}
ER3 AlignExpr(ImageLimit(ER2), PAGE_ALIGNMENT)
{
file3.o(*)
}
}