Defining the Target's Memory Map

Use the linker command file's MEMORY directive to delineate areas in the target platform's memory map and associate a name for each of these areas. Names defined in a MEMORY directive may be used later in the linker command file to specify where object code should be stored. MEMORY directive example shows an example.

Listing 1. MEMORY directive example
MEMORY
{
   ISR_table : org = 0x00000000, len = 0x400
   data : org = 0x00000400, len = 0x10000
   flash: org = 0x10000000, len = 0x10000
   text : org = 0x80000000   

}

This example defines 4 memory areas named ISR_table , data, flash , and text . The org argument specifies the beginning byte address of a memory area. The len argument is optional, It specifies how many bytes of data or executable code the linker may store in an area. The linker issues a warning message if an attempt to store object code in an area exceeds its length.

Related information
Specifying Link Order in the IDE
Dead-Stripping
Defining Sections in the Output File
Associating Input Sections With Output Sections
Controlling Alignment
Specifying Memory Area Locations and Sizes
Creating Memory Gaps
Creating Symbols
Linker Command File Syntax
Commands, Directives, and Keywords