]> rtime.felk.cvut.cz Git - arc.git/blob - arch/ppc/mpc55xx/scripts/linkscript_gcc.ldf
146e6443623f39474eea496f10557ebb7b0fc8ce
[arc.git] / arch / ppc / mpc55xx / scripts / linkscript_gcc.ldf
1 /* \r
2  * Copyright (C) 2009  ArcCore AB <contact@arccore.com> \r
3  */\r
4 \r
5 #include "Calibration_Settings.h"\r
6 /* Undef sections/keywords */ \r
7 #undef PPC\r
8 \r
9 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")\r
10 OUTPUT_ARCH(powerpc)\r
11 ENTRY(_start)\r
12 \r
13 /*\r
14  * _idata - Start of .data in flash \r
15  * _data  - start address of .data in RAM\r
16  * _edata  - end address of .data  in RAM\r
17  * _bss   - start address of .bss\r
18  * _ebss   - end address of .bss\r
19  * _etext  - end of .text\r
20  * _end    - End of something.... \r
21  * \r
22  * More stuff:\r
23  *    \r
24  *  _arc_heap_start\r
25  *  _arc_heap_end\r
26  *  _arc_stack\r
27  *\r
28  * Dwarf stuff: (same as Dwarf3 .debug_frame? )\r
29  *  eh_frame_hdr (C++ only? unwind info for C++ exceptions?)\r
30  *  eh_frame     (C++ only?)\r
31  *\r
32  * Exception table:\r
33  *  _exc_frame_start\r
34  *  _exc_frame_end\r
35  *\r
36  *  PowerPC EABI special:\r
37  *  _SDA2_BASE_\r
38  *  _SDA_BASE\r
39  */\r
40 \r
41 MEMORY\r
42 {\r
43         #include "memory.ldf"\r
44 }\r
45 \r
46 SECTIONS\r
47 {\r
48 \r
49 #if 0\r
50 /* __CALIB_RAM_START, __CALIB_RAM_END, __CALIB_ROM_START are needed by the a2l and the rte generator. \r
51   CALIBRATION_ENABLED, CALIBRATION_INITIALIZED_RAM, CALIBRATION_FLS_START are generated by rte \r
52 */\r
53 #if defined(CALIBRATION_ENABLED)\r
54 #if defined(CALIBRATION_INITIALIZED_RAM)\r
55 /* when calibration is active a flash and ram area is needed. the rte will copy the calibration area from flash to ram. */\r
56         .calibration : AT(CALIBRATION_FLS_START) {      \r
57                         *(.calibration)\r
58         } > ram         \r
59 #else /* CALIBRATION_INITIALIZED_RAM */\r
60 /* when calibration isnt active only a flash area is needed. */         \r
61         .calibration CALIBRATION_FLS_START : {\r
62                         *(.calibration)\r
63         } > flash       \r
64 #endif\r
65 \r
66 __CALIB_RAM_START = ADDR(.calibration);\r
67 __CALIB_RAM_END = ADDR(.calibration) + SIZEOF(.calibration);\r
68 __CALIB_ROM_START       = LOADADDR(.calibration);\r
69 #else\r
70         /* failsafe to avoid trouble with defined calib variables if CALIBRATION_ENABLED is not set */\r
71         .calibration : {\r
72                         *(.calibration)\r
73         } > flash\r
74         ASSERT(SIZEOF(.calibration) == 0, ".calibration section used but CALIBRATION_ENABLED is undefined")\r
75 #endif /* CALIBRATION_ENABLED */\r
76 \r
77 \r
78 #if defined(USE_FEE)\r
79 #include "Fee_Memory_Cfg.h"\r
80 \r
81            .fee_bank1 FEE_BANK1_OFFSET : {\r
82                       . = . + FEE_BANK1_LENGTH;\r
83            } > flash\r
84 \r
85            .fee_bank2 FEE_BANK2_OFFSET : {\r
86                       . = . + FEE_BANK2_LENGTH;\r
87            } > flash\r
88 #endif\r
89 \r
90 #if defined(USE_FEE) || defined(CALIBRATION_ENABLED)\r
91 /* Place the rest of the code is in another flash partition that the calibration and fee banks. */\r
92 __FLS_PROG_START__ = 0x20000;   /* Must be aligned to a sector start. */\r
93 #else\r
94 \r
95 __FLS_PROG_START__ = 0; /* Must be aligned to a sector start. */\r
96 #endif\r
97 \r
98 #if !defined(CFG_BOOT)\r
99         .rcw __FLS_PROG_START__ : { *(.rcw) } > flash\r
100 #endif\r
101 #endif\r
102     .text :\r
103         {\r
104             crt0.o(.text);\r
105         *(.text .text.* .init .fini* .eini* .gnu.linkonce* .gnu.warning);\r
106         PROVIDE( btask_sup_matrix = .);\r
107         SORT(*)(.test_btask);\r
108         PROVIDE( etask_sup_matrix = .);\r
109         SORT(*)(.test_etask);\r
110         } > flash\r
111 \r
112         .fls_rom : {\r
113         __FLS_ERASE_ROM__ = .;\r
114         *(.fls_erase);\r
115         __FLS_WRITE_ROM__ = .;\r
116         *(.fls_write);\r
117         __FLS_END_ROM__ = .;\r
118         } > flash\r
119 \r
120 /* mpc5554, align 64K. mpc5516, 4k */\r
121     .exception_tbl ALIGN(0x10000) :\r
122     {\r
123       *(.isr_vector)\r
124     } > flash\r
125 \r
126         /* Read-only data section. */\r
127         .rodata :       { \r
128                 *(.rodata .rodata.* .gnu.linkonce.r.*);\r
129                 *(.got.plt) *(.got)\r
130         } > flash\r
131 \r
132         /* initialized read-only small data section. */\r
133         .sdata2 :       {\r
134                 _SDA2_BASE_ = .; /* r2 */\r
135                 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*);\r
136                 *(PPC.EMB.sdata2 .PPC.EMB.sbss2)\r
137                 . = ALIGN(0x10); \r
138         } > flash\r
139 \r
140         /* uninitialized read-only small data section. */\r
141         .sbss2 : {\r
142                 *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*);\r
143                 __TEXT_END = .;\r
144         } > flash\r
145 \r
146 #if defined(CFG_MPC5516)\r
147         .McuE_LowPowerRecoverFlash 0x000ff000: {\r
148             *(.lowpower_text);\r
149         }\r
150         .lowpower_vector 0x000ffffc: {\r
151             *(.lowpower_vector);\r
152         }\r
153 #endif  \r
154         \r
155 \r
156         .data : {\r
157                 __DATA_RAM = .; \r
158                 *(.data .data.* .gnu.linkonce.d.* .gnu.linkonce.r.* .eh_frame)\r
159                 . = ALIGN(0x10);\r
160         } > ram AT> flash\r
161 \r
162         .sdata : {\r
163                 __SDATA_START__ = .;\r
164                 _SDA_BASE_ = .;         /* r13 */\r
165                 *(.sdata .sdata.* .gnu.linkonce.s.*)\r
166                 *(PPC.EMB.sdata2 .PPC.EMB.sbss2)\r
167                 __DATA_END = .;\r
168         } > ram AT> flash\r
169 \r
170     .sbss :\r
171         {\r
172                 __SBSS_START__ = .;\r
173                 *(.sbss .sbss.* .scommon .gnu.linkonce.sb.* .t32_outport);\r
174                 __SBSS_END__ = .;\r
175                 _end = .;\r
176         } > ram\r
177 \r
178         .t32_outport ALIGN(0x10): \r
179         { \r
180                 *(.t32_outport); \r
181         }                       > ram\r
182                 \r
183         .bss (NOLOAD) :  \r
184         {\r
185                 *(.got2);\r
186                 *(.fixup);\r
187                 *(.bss .bss.* COMMON .gnu.linkonce.b.*);\r
188                 __BSS_END       = .; \r
189         }       > ram\r
190         \r
191         .init_stack ALIGN(16) (NOLOAD) : \r
192         {       \r
193                 __SP_END        = .;\r
194                 . = . + 1000;   \r
195                 __SP_INIT       = .; \r
196         } > ram\r
197         \r
198         /* Fls RAM section */\r
199         .fls_ram ALIGN(16) (NOLOAD) : {\r
200                 __FLS_ERASE_RAM__ = .;\r
201                 . = . + SIZEOF(.fls_rom);\r
202         } > ram\r
203   .ctors          :\r
204   {\r
205     KEEP (*(SORT(.ctors.*)))\r
206   }\r
207 \r
208 .uninit ALIGN(0x10) (NOLOAD) : { *(.winidea_port .ramlog .dem_eventmemory_pri) ; }                      > ram\r
209 \r
210         /* Always place last in RAM */\r
211         .heap ALIGN(0x4): {\r
212                 PROVIDE(_heap_start = .);\r
213         } > ram\r
214 \r
215 \r
216         __FLS_SIZE__ = SIZEOF(.fls_rom);\r
217         __FLS_WRITE_RAM__ =  __FLS_ERASE_RAM__ + (__FLS_WRITE_ROM__ - __FLS_ERASE_ROM__);\r
218 \r
219    /* Stabs debugging sections.  */\r
220   .stab          0 : { *(.stab) }\r
221   .stabstr       0 : { *(.stabstr) }\r
222   .stab.excl     0 : { *(.stab.excl) }\r
223   .stab.exclstr  0 : { *(.stab.exclstr) }\r
224   .stab.index    0 : { *(.stab.index) }\r
225   .stab.indexstr 0 : { *(.stab.indexstr) }\r
226   .comment       0 : { *(.comment) }\r
227   /* DWARF debug sections.\r
228      Symbols in the DWARF debugging sections are relative to the beginning\r
229      of the section so we begin them at 0.  */\r
230   /* DWARF 1 */\r
231   .debug          0 : { *(.debug) }\r
232   .line           0 : { *(.line) }\r
233   /* GNU DWARF 1 extensions */\r
234   .debug_srcinfo  0 : { *(.debug_srcinfo) }\r
235   .debug_sfnames  0 : { *(.debug_sfnames) }\r
236   /* DWARF 1.1 and DWARF 2 */\r
237   .debug_aranges  0 : { *(.debug_aranges) }\r
238   .debug_pubnames 0 : { *(.debug_pubnames) }\r
239   /* DWARF 2 */\r
240   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }\r
241   .debug_abbrev   0 : { *(.debug_abbrev) }\r
242   .debug_line     0 : { *(.debug_line) }\r
243   .debug_frame    0 : { *(.debug_frame) }\r
244   .debug_str      0 : { *(.debug_str) }\r
245   .debug_loc      0 : { *(.debug_loc) }\r
246   .debug_macinfo  0 : { *(.debug_macinfo) }\r
247   /* SGI/MIPS DWARF 2 extensions */\r
248   .debug_weaknames 0 : { *(.debug_weaknames) }\r
249   .debug_funcnames 0 : { *(.debug_funcnames) }\r
250   .debug_typenames 0 : { *(.debug_typenames) }\r
251   .debug_varnames  0 : { *(.debug_varnames) }\r
252 }\r
253 \r
254 _heap_end = ORIGIN(ram) + LENGTH(ram);\r
255 \r
256 __TEXT_START            = ADDR(.text);\r
257 __RAM_START             = ADDR(.sdata);\r
258 \r
259 __DATA_RAM              = ADDR(.data);\r
260 __DATA_ROM          = LOADADDR(.data);\r
261 /*__DATA_END            = ADDR(.sdata)+SIZEOF(.sdata);*/\r
262 /*__BSS_START           = ADDR(.sbss);*/\r
263 __BSS_START             = ADDR(.sbss);\r
264 \r
265 /* _SDA_BASE_ and _SDA2_BASE_ is defined in e500 ABI\r
266  * Some of the symbols below is used by eabi() that does interesting.\r
267  * Can't get rid of it even with no-eabi option\r
268  */\r
269 \r
270 /* __SBSS_END__                 = ADDR(.sbss) + SIZEOF(.sbss); */\r
271  __SDATA2_START__       = ADDR(.sdata2);\r
272  __SBSS2_END__          = ADDR(.sbss2) + SIZEOF(.sbss2);\r
273 //__GOT_START__         = ADDR(.got);\r
274 //__GOT_END__                   = ADDR(.got) + SIZEOF(.got);\r
275 //__GOT2_START__                = ADDR(.got2);\r
276 //__GOT2_END__          = ADDR(.got2) + SIZEOF(.got2);\r
277 //__FIXUP_START__               = ADDR(.fixup);\r
278 //__FIXUP_END__         = ADDR(.fixup) + SIZEOF(.fixup);\r
279 \r
280 __EXCEPT_START__        = 0x0;\r
281 __EXCEPT_END__          = 0x0;\r
282 \r
283 \r
284 \r
285 \r
286 \r
287 \r
288 \r
289 \r
290 \r
291 \r
292 \r
293 \r
294 \r
295 \r
296 \r
297 \r
298 \r
299 \r
300 \r
301 \r
302 \r
303 \r
304 \r
305 \r
306 \r