User and program memory refers to all the memory that the executable requires during execution.
- By convention, this includes memories for storing instructions, read-only data, read-write data, program stack, and program heap.
- These sections can be stored in any addressable memory in your system.
- By default, the compiler generates code and data starting from the address listed in the table in Reserved Memory and occupying contiguous memory locations. This is the most common memory layout for programs.
- You can modify the starting location of your program by defining (in the linker) the
symbol
_TEXT_START_ADDRfor MicroBlaze and MicroBlaze V,START_ADDRfor Arm.
In special cases, you can partition the various sections of your ELF file across memories using the linker command language. See Linker Scripts for details. The following are situations where changing the memory map of your executable can be necessary.
- When partitioning large code segments across multiple smaller memories
- Remapping frequently executed sections to fast memories
- Mapping read-only segments to non-volatile flash memories
No restrictions apply to how you can partition your executable. The partitioning can be done at the output section level, or even at the individual function and data level. The resulting ELF can be non-contiguous, that is, there can be “holes” in the memory map. Ensure that you do not use documented reserved locations.
If you are an advanced user, you can modify the default binary data for the reserved memory locations. In this case, you must replace the default startup files and the memory mappings from the linker.