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