2.4 Default memory map

In an image where you have not described the memory map, the linker places code and data according to a default memory map.

Figure 2-2 Default memory map
To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.

Note

The processors based on ARMv6-M and ARMv7-M architectures have fixed memory maps. This makes porting software easier between different systems based on these processors.
The default memory map is described as follows:
  • The image is linked to load and run at address 0x8000. All Read Only (RO) sections are placed first, followed by Read-Write (RW) sections, then Zero Initialized (ZI) sections.
  • The heap follows directly on from the top of ZI, so the exact location is decided at link time.
  • The stack base location is provided by a semihosting operation during application startup. The value returned by this semihosting operation depends on the debug environment.
The linker observes a set of rules to decide where in memory code and data are located:
Figure 2-3 Linker placement rules
To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.

Generally, the linker sorts the input sections by attribute, by name, and then by position in the input list.
To fully control the placement of code and data you must use the scatter-loading mechanism.
Related concepts
2.6 Tailoring the C library to your target hardware
Related information
The image structure
Section placement with the linker
About scatter-loading
Scatter file syntax
Cortex-M1 Technical Reference Manual
Cortex-M3 Technical Reference Manual
Non-ConfidentialPDF file icon PDF versionARM DUI0471K
Copyright © 2010-2014 ARM. All rights reserved.