1 /*;******************** (C) COPYRIGHT 2007 STMicroelectronics ******************
\r
2 ;* File Name : lnkarm_flash.xcl
\r
3 ;* Author : MCD Application Team
\r
4 ;* Date First Issued : 02/19/2007
\r
5 ;* Description : XLINK command file template for EWARM/ICCARM
\r
6 ;* Usage : xlink -f lnkarm <your_object_file(s)>
\r
7 ;* :-s <program start label> <C/C++ runtime library>
\r
8 ;*******************************************************************************
\r
12 ;*******************************************************************************
\r
13 ; THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
\r
14 ; WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
\r
15 ; AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
\r
16 ; INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
\r
17 ; CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
\r
18 ; INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
\r
19 ;******************************************************************************/
\r
21 // Code memory in FLASH
\r
22 -DROMSTART=0x8000000
\r
26 -DRAMSTART=0x20000000
\r
29 //*************************************************************************
\r
31 // Code segments - may be placed anywhere in memory.
\r
34 // INTVEC -- Exception vector table.
\r
35 // SWITAB -- Software interrupt vector table.
\r
36 // ICODE -- Startup (cstartup) and exception code.
\r
37 // DIFUNCT -- Dynamic initialization vectors used by C++.
\r
38 // CODE -- Compiler generated code.
\r
39 // CODE_I -- Compiler generated code declared __ramfunc (executes in RAM)
\r
40 // CODE_ID -- Initializer for CODE_I (ROM).
\r
43 // Data segments - may be placed anywhere in memory.
\r
46 // CSTACK -- The stack used by C/C++ programs (system and user mode).
\r
47 // HEAP -- The heap used by malloc and free in C and new and
\r
49 // INITTAB -- Table containing addresses and sizes of segments that
\r
50 // need to be initialized at startup (by cstartup).
\r
51 // CHECKSUM -- The linker places checksum byte(s) in this segment,
\r
52 // when the -J linker command line option is used.
\r
53 // DATA_y -- Data objects.
\r
55 // Where _y can be one of:
\r
57 // _AN -- Holds uninitialized located objects, i.e. objects with
\r
58 // an absolute location given by the @ operator or the
\r
59 // #pragma location directive. Since these segments
\r
60 // contain objects which already have a fixed address,
\r
61 // they should not be mentioned in this linker command
\r
63 // _C -- Constants (ROM).
\r
64 // _I -- Initialized data (RAM).
\r
65 // _ID -- The original content of _I (copied to _I by cstartup) (ROM).
\r
66 // _N -- Uninitialized data (RAM).
\r
67 // _Z -- Zero initialized data (RAM).
\r
69 // Note: Be sure to use end values for the defined address ranges.
\r
70 // Otherwise, the linker may allocate space outside the
\r
71 // intended memory range.
\r
72 //*************************************************************************
\r
75 //************************************************
\r
76 // Inform the linker about the CPU family used.
\r
77 //************************************************
\r
81 //*************************************************************************
\r
82 // Segment placement - General information
\r
84 // All numbers in the segment placement command lines below are interpreted
\r
85 // as hexadecimal unless they are immediately preceded by a '.', which
\r
86 // denotes decimal notation.
\r
88 // When specifying the segment placement using the -P instead of the -Z
\r
89 // option, the linker is free to split each segment into its segment parts
\r
90 // and randomly place these parts within the given ranges in order to
\r
91 // achieve a more efficient memory usage. One disadvantage, however, is
\r
92 // that it is not possible to find the start or end address (using
\r
93 // the assembler operators .sfb./.sfe.) of a segment which has been split
\r
96 // When generating an output file which is to be used for programming
\r
97 // external ROM/Flash devices, the -M linker option is very useful
\r
98 // (see xlink.pdf for details).
\r
99 //*************************************************************************
\r
102 //*************************************************************************
\r
103 // Read-only segments mapped to ROM.
\r
104 //*************************************************************************
\r
106 //************************************************
\r
107 // Address range for reset and exception
\r
108 // vectors (INTVEC).
\r
109 //************************************************
\r
111 -Z(CODE)INTVEC=ROMSTART-ROMEND
\r
113 //************************************************
\r
114 // Startup code and exception routines (ICODE).
\r
115 //************************************************
\r
117 -Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND
\r
118 -Z(CODE)SWITAB=ROMSTART-ROMEND
\r
120 //************************************************
\r
121 // Code segments may be placed anywhere.
\r
122 //************************************************
\r
124 -Z(CODE)CODE=ROMSTART-ROMEND
\r
126 //************************************************
\r
127 // Original ROM location for __ramfunc code copied
\r
128 // to and executed from RAM.
\r
129 //************************************************
\r
131 -Z(CONST)CODE_ID=ROMSTART-ROMEND
\r
133 //************************************************
\r
134 // Various constants and initializers.
\r
135 //************************************************
\r
137 -Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND
\r
138 -Z(CONST)CHECKSUM=ROMSTART-ROMEND
\r
141 //*************************************************************************
\r
142 // Read/write segments mapped to RAM.
\r
143 //*************************************************************************
\r
145 //************************************************
\r
147 //************************************************
\r
149 -Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND
\r
151 //************************************************
\r
152 // __ramfunc code copied to and executed from RAM.
\r
153 //************************************************
\r
155 -Z(DATA)CODE_I=RAMSTART-RAMEND
\r
157 //************************************************
\r
158 // ICCARM produces code for __ramfunc functions in
\r
159 // CODE_I segments. The -Q XLINK command line
\r
160 // option redirects XLINK to emit the code in the
\r
161 // CODE_ID segment instead, but to keep symbol and
\r
162 // debug information associated with the CODE_I
\r
163 // segment, where the code will execute.
\r
164 //************************************************
\r
168 //*************************************************************************
\r
169 // Stack and heap segments.
\r
170 //*************************************************************************
\r
175 -Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND
\r
176 -Z(DATA)HEAP+_HEAP_SIZE=RAMSTART-RAMEND
\r
178 //*************************************************************************
\r
179 // ELF/DWARF support.
\r
181 // Uncomment the line "-Felf" below to generate ELF/DWARF output.
\r
182 // Available format specifiers are:
\r
184 // "-yn": Suppress DWARF debug output
\r
185 // "-yp": Multiple ELF program sections
\r
186 // "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag)
\r
188 // "-Felf" and the format specifiers can also be supplied directly as
\r
189 // command line options, or selected from the Xlink Output tab in the
\r
190 // IAR Embedded Workbench.
\r
191 //*************************************************************************
\r