 RealView Linker and Utilities Guide |
|
| Region-related symbols4.2.1. Region-related symbolsRegion-related symbols are generated when the linker creates an image. Table 4.1 shows the symbols that the linker generates for every execution region present in the image. Table 4.1. Region-related linker symbols | Symbol | Description |
|---|
Load$$region_name$$Base | Load address of the region | Image$$region_name$$Base | Execution address of the region | Image$$region_name$$Length | Execution region length in bytes (multiple of 4) excluding ZI length | Image$$region_name$$Limit | Address of the byte beyond the end of the non ZI part of the execution region | Image$$region_name$$RO$$Base | Execution address of the RO output section in this region | Image$$region_name$$RO$$Length | Length of the RO output section in bytes (multiple of 4) | Image$$region_name$$RO$$Limit | Address of the byte beyond the end of the RO output section in the execution region | Image$$region_name$$RW$$Base | Execution address of the RW output section in this region | Image$$region_name$$RW$$Length | Length of the RW output section in bytes (multiple of 4) | Image$$region_name$$RW$$Limit | Address of the byte beyond the end of the RW output section in the execution region | Image$$region_name$$ZI$$Base | Execution address of the ZI output section in this region | Image$$region_name$$ZI$$Length | Length of the ZI output section in bytes (multiple of 4) | Image$$region_name$$ZI$$Limit | Address of the byte beyond the end of the ZI output section in the execution region |
If you are not using scatter-loading, the linker uses region_name values of: ER_RO, for read-only execution regions
ER_RW, for read-write execution regions
ER_ZI, for zero-initialized execution regions.
NoteThe ZI output sections of an image are not created statically, but are automatically created dynamically at runtime. Therefore, there is no load address symbol for ZI output sections. It is recommended that you use region-related symbols in preference to section-related symbols.
Using scatter-loading description filesIf you are using scatter-loading, the description file names all the execution regions in the image, and provides their load and execution addresses. If the description file defines both stack and heap, the linker also generates special stack and heap symbols. See Chapter 5 Using Scatter-loading Description Files for more information. Placing the stack and heap above the ZI regionOne common use of region-related symbols is to place a heap directly above the ZI region. Example 4.1 shows how to create a retargeted version of __user_initial_stackheap() in assembly language. The example assumes that you are using the default one region memory model from the ARM C libraries. See __user_initial_stackheap() in the Libraries Guide for more information. Example 4.1. Placing the stack and heap above the ZI region
EXPORT __user_initial_stackheap
IMPORT ||Image$$region_name$$ZI$$Limit||
__user_initial_stackheap
LDR r0, =||Image$$region_name$$ZI$$Limit||
MOV pc, lr
|
|