4.2.2. Section-related symbols
The output section symbols shown in Table 4.2 are generated if you use command-line options to create a simple image. A simple image has three output sections (RO, RW, and ZI) that produce the three execution regions. For every input section present in the image, the linker generates the input symbols shown in Table 4.3.
The linker sorts sections within an execution region first by attribute RO, RW, or ZI, then by name. So, for example, all .text sections are placed in one contiguous block. A contiguous block of sections with the same attribute and name is known as a consolidated section.
If you are using a scatter-loading description file, the output section symbols in Table 4.2 are undefined. If your code accesses these symbols, you must treat it as a weak reference.
The standard implementation of __user_initial_stackheap() uses the value in Image$$ZI$$Limit. Therefore, if you are using a scatter-loading description file you might have to re-implement __user_initial_stackheap() to set the heap and stack boundaries. For more information, see Chapter 5 Using Scatter-loading Description Files.
Table 4.2. Image-related symbols
| Symbol | Section type | Description |
|---|
Image$$RO$$Base | Output | Address of the start of the RO output section. |
Image$$RO$$Limit | Output | Address of the first byte beyond the end of the RO output section. |
Image$$RW$$Base | Output | Address of the start of the RW output section. |
Image$$RW$$Limit | Output | Address of the byte beyond the end of the ZI output section. (The choice of the end of the ZI region rather than the end of the RW region is to maintain compatibility with legacy code.) |
Image$$ZI$$Base | Output | Address of the start of the ZI output section. |
Image$$ZI$$Limit | Output | Address of the byte beyond the end of the ZI output section. |
If your code refers to the input-section symbols, it is assumed that you expect all the input sections in the image with the same name to be placed contiguously in the image memory map. If your scatter-loading description places these input sections non contiguously, the linker diagnoses an error because the use of the base and limit symbols over non contiguous memory usually produces unpredictable and undesirable effects.
Table 4.3. Section-related symbols
| Symbol | Section type | Description |
|---|
SectionName$$Base | Input | Address of the start of the consolidated section called SectionName. |
SectionName$$Length | Input | Length of the consolidated section called SectionName (in bytes). |
SectionName$$Limit | Input | Address of the byte beyond the end of the consolidated section called SectionName. |