]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_LM3S316_IAR/hw_include/lnkarm.xcl
UpdUpdate IAR projects to use Embedded Workbench V5.11.
[freertos] / Demo / CORTEX_LM3S316_IAR / hw_include / lnkarm.xcl
1 //*************************************************************************\r
2 // XLINK command file template for EWARM/ICCARM\r
3 //\r
4 // Usage:  xlink  -f lnkarm  <your_object_file(s)>\r
5 //                -s <program start label>  <C/C++ runtime library>\r
6 //\r
7 // $Revision: 1.32 $\r
8 //*************************************************************************\r
9 \r
10 //*************************************************************************\r
11 // In this file it is assumed that the system has the following\r
12 // memory layout:\r
13 //\r
14 //   Exception vectors [0x000000--0x00001F]  RAM or ROM\r
15 //   ROMSTART--ROMEND  [0x008000--0x0FFFFF]  ROM (or other non-volatile memory)\r
16 //   RAMSTART--RAMEND  [0x100000--0x7FFFFF]  RAM (or other read/write memory)\r
17 //\r
18 // -------------\r
19 // Code segments - may be placed anywhere in memory.\r
20 // -------------\r
21 //\r
22 //   INTVEC     -- Exception vector table.\r
23 //   SWITAB     -- Software interrupt vector table.\r
24 //   ICODE      -- Startup (cstartup) and exception code.\r
25 //   DIFUNCT    -- Dynamic initialization vectors used by C++.\r
26 //   CODE       -- Compiler generated code.\r
27 //   CODE_I     -- Compiler generated code declared __ramfunc (executes in RAM)\r
28 //   CODE_ID    -- Initializer for CODE_I (ROM).\r
29 //\r
30 // -------------\r
31 // Data segments - may be placed anywhere in memory.\r
32 // -------------\r
33 //\r
34 //   CSTACK     -- The stack used by C/C++ programs (system and user mode).\r
35 //   IRQ_STACK  -- The stack used by IRQ service routines.\r
36 //   SVC_STACK  -- The stack used in supervisor mode\r
37 //                 (Define other exception stacks as needed for\r
38 //                 FIQ, ABT, UND).\r
39 //   HEAP       -- The heap used by malloc and free in C and new and\r
40 //                 delete in C++.\r
41 //   INITTAB    -- Table containing addresses and sizes of segments that\r
42 //                 need to be initialized at startup (by cstartup).\r
43 //   CHECKSUM   -- The linker places checksum byte(s) in this segment,\r
44 //                 when the -J linker command line option is used.\r
45 //   DATA_y     -- Data objects.\r
46 //\r
47 // Where _y can be one of:\r
48 //\r
49 //   _AN        -- Holds uninitialized located objects, i.e. objects with\r
50 //                 an absolute location given by the @ operator or the\r
51 //                 #pragma location directive. Since these segments\r
52 //                 contain objects which already have a fixed address,\r
53 //                 they should not be mentioned in this linker command\r
54 //                 file.\r
55 //   _C         -- Constants (ROM).\r
56 //   _I         -- Initialized data (RAM).\r
57 //   _ID        -- The original content of _I (copied to _I by cstartup) (ROM).\r
58 //   _N         -- Uninitialized data (RAM).\r
59 //   _Z         -- Zero initialized data (RAM).\r
60 //\r
61 // Note:  Be sure to use end values for the defined address ranges.\r
62 //        Otherwise, the linker may allocate space outside the\r
63 //        intended memory range.\r
64 //*************************************************************************\r
65 \r
66 \r
67 //************************************************\r
68 // Inform the linker about the CPU family used.\r
69 //************************************************\r
70 \r
71 -carm\r
72 \r
73 //*************************************************************************\r
74 // Segment placement - General information\r
75 //\r
76 // All numbers in the segment placement command lines below are interpreted\r
77 // as hexadecimal unless they are immediately preceded by a '.', which\r
78 // denotes decimal notation. \r
79 //\r
80 // When specifying the segment placement using the -P instead of the -Z\r
81 // option, the linker is free to split each segment into its segment parts\r
82 // and randomly place these parts within the given ranges in order to\r
83 // achieve a more efficient memory usage. One disadvantage, however, is\r
84 // that it is not possible to find the start or end address (using\r
85 // the assembler operators .sfb./.sfe.) of a segment which has been split\r
86 // and reformed. \r
87 //\r
88 // When generating an output file which is to be used for programming\r
89 // external ROM/Flash devices, the -M linker option is very useful \r
90 // (see xlink.pdf for details).\r
91 //*************************************************************************\r
92 \r
93 \r
94 //*************************************************************************\r
95 // Read-only segments mapped to ROM.\r
96 //*************************************************************************\r
97 \r
98 -DROMSTART=08000\r
99 -DROMEND=FFFFF\r
100 \r
101 //************************************************\r
102 // Address range for reset and exception\r
103 // vectors (INTVEC).\r
104 // The vector area is 32 bytes, \r
105 // an additional 32 bytes is allocated for the\r
106 // constant table used by ldr PC in cstartup.s79.\r
107 //************************************************\r
108 \r
109 -Z(CODE)INTVEC=00-3F\r
110 \r
111 //************************************************\r
112 // Startup code and exception routines (ICODE).\r
113 //************************************************\r
114 \r
115 -Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND\r
116 -Z(CODE)SWITAB=ROMSTART-ROMEND\r
117 \r
118 //************************************************\r
119 // Code segments may be placed anywhere.\r
120 //************************************************\r
121 \r
122 -Z(CODE)CODE=ROMSTART-ROMEND\r
123 \r
124 //************************************************\r
125 // Original ROM location for __ramfunc code copied\r
126 // to and executed from RAM.\r
127 //************************************************\r
128 \r
129 -Z(CONST)CODE_ID=ROMSTART-ROMEND\r
130 \r
131 //************************************************\r
132 // Various constants and initializers.\r
133 //************************************************\r
134 \r
135 -Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND\r
136 -Z(CONST)CHECKSUM=ROMSTART-ROMEND\r
137 \r
138 //*************************************************************************\r
139 // Read/write segments mapped to RAM.\r
140 //*************************************************************************\r
141 \r
142 -DRAMSTART=100000\r
143 -DRAMEND=7FFFFF\r
144 \r
145 //************************************************\r
146 // Data segments.\r
147 //************************************************\r
148 \r
149 -Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND\r
150 \r
151 //************************************************\r
152 // __ramfunc code copied to and executed from RAM.\r
153 //************************************************\r
154 \r
155 -Z(DATA)CODE_I=RAMSTART-RAMEND\r
156 \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
165 \r
166 -QCODE_I=CODE_ID\r
167 \r
168 //*************************************************************************\r
169 // Stack and heap segments.\r
170 //*************************************************************************\r
171 \r
172 -D_CSTACK_SIZE=2000\r
173 // -D_SVC_STACK_SIZE=10\r
174 -D_IRQ_STACK_SIZE=100\r
175 -D_HEAP_SIZE=8000\r
176 \r
177 -Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND\r
178 // -Z(DATA)SVC_STACK+_SVC_STACK_SIZE=RAMSTART-RAMEND\r
179 -Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE,HEAP+_HEAP_SIZE=RAMSTART-RAMEND\r
180 \r
181 //*************************************************************************\r
182 // ELF/DWARF support.\r
183 //\r
184 // Uncomment the line "-Felf" below to generate ELF/DWARF output.\r
185 // Available format specifiers are:\r
186 //\r
187 //   "-yn": Suppress DWARF debug output\r
188 //   "-yp": Multiple ELF program sections\r
189 //   "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag)\r
190 //\r
191 // "-Felf" and the format specifiers can also be supplied directly as\r
192 // command line options, or selected from the Xlink Output tab in the\r
193 // IAR Embedded Workbench.\r
194 //*************************************************************************\r
195 \r
196 // -Felf\r