6.7. Generating linker command files

The memory map, shown in the Process Control Map tab, can be used to generate or modify a MEMORY section of a linker command file used in your application building. This MEMORY directive information can then be used to correctly position various sections of an application. For details of how to set up such command options see Chapter 12 Managing Projects.

To generate or modify a linker command file:

  1. Right-click on the start address at the top of the entries and select Save Map to Linker Command File... from the context menu.

  2. Specify the location of the file in the Select Linker Command File to Create or Modify dialog box. Remember that:

    • If the file already exists, RealView Debugger looks for a MEMORY directive block created previously and, if found, replaces that block.

    • If the file already exists, but no MEMORY directive block exists, RealView Debugger locates the first MEMORY section and inserts the MEMORY directive block before it.

    • If the file already exists, RealView Debugger makes a backup copy before updating the contents.

    • If there is no existing file, RealView Debugger creates the specified file ready to accept the MEMORY directive block.

The RealView Debugger linker command file generation process uses the built-in automatic memory mapping to generate data based on the connected target settings, for example the registers that control mapping.

The data recorded in the generated MEMORY block includes each internal RAM, ROM, and Flash section as appropriate. Each section is allocated a predefined name. All external memory added using the Map tab, or defined automatically from a loaded image, is allocated a name based on the characteristics of the memory.

An example of a generated linker command file is shown in Example 6.1. The generated command file for your evaluation board might be different to this example.

Example 6.1. 

/* Linker Command file for the ARM processor */
/* This file was generated by RVDEBUG. You can edit everything 
   outside the MEMORY block defined by RVDEBUG. Updates by
   RVDEBUG will only affect that block.			*/

/* RVDEBUG: generated data block. Updated Wed Mar 19 17:23:41 2003
   Do not modify this block. Do not put MEMORY lines above
   this line, put below end of this block.		*/
MEMORY
{
  /* Register @G_CM_CTRL has (masked) value 0000 */
  /* Register @G_CM_SDRAM has (masked) value 0000 */
  M_BootROM(R): org=0x0000, len=0x3FFFF  /* external WaitStates=5 'Boot' */
  M_CM_Regs:    org=0x10000000, len=0xFFFFFF  /* external WaitStates=1 'CM Registers' */
}
/* RVDEBUG: generated data above */

This example shows a combination of internal memory based on current register settings (@G_CM_CTRL and @G_CM_SDRAM) in addition to external memory as defined by the loading of a program.

The following notes apply to this automatic file generation process:

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B
Non-Confidential