]> rtime.felk.cvut.cz Git - arc.git/blob - arch/ppc/mpc55xx/scripts/linkscript_gcc.ldf
Re-added generic callout stubs file for Dcm (with make rule).
[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 /* __CALIB_RAM_START, __CALIB_RAM_END, __CALIB_ROM_START are needed by the a2l and the rte generator. \r
49   CALIBRATION_ENABLED, CALIBRATION_INITIALIZED_RAM, CALIBRATION_FLS_START are generated by rte \r
50 */\r
51 #if defined(CALIBRATION_ENABLED)\r
52 #if defined(CALIBRATION_INITIALIZED_RAM)\r
53 /* when calibration is active a flash and ram area is needed. the rte will copy the calibration area from flash to ram. */\r
54         .calibration : AT(CALIBRATION_FLS_START) {      \r
55                         *(.calibration)\r
56         } > ram         \r
57 #else /* CALIBRATION_INITIALIZED_RAM */\r
58 /* when calibration isnt active only a flash area is needed. */         \r
59         .calibration CALIBRATION_FLS_START : {\r
60                         *(.calibration)\r
61         } > flash       \r
62 #endif\r
63 \r
64 __CALIB_RAM_START = ADDR(.calibration);\r
65 __CALIB_RAM_END = ADDR(.calibration) + SIZEOF(.calibration);\r
66 __CALIB_ROM_START       = LOADADDR(.calibration);\r
67 #else\r
68         /* failsafe to avoid trouble with defined calib variables if CALIBRATION_ENABLED is not set */\r
69         .calibration : {\r
70                         *(.calibration)\r
71         } > flash\r
72         ASSERT(SIZEOF(.calibration) == 0, ".calibration section used but CALIBRATION_ENABLED is undefined")\r
73 #endif /* CALIBRATION_ENABLED */\r
74 \r
75 \r
76 #if defined(USE_FEE)\r
77 #include "Fee_Memory_Cfg.h"\r
78 \r
79            .fee_bank1 FEE_BANK1_OFFSET : {\r
80                       . = . + FEE_BANK1_LENGTH;\r
81            } > flash\r
82 \r
83            .fee_bank2 FEE_BANK2_OFFSET : {\r
84                       . = . + FEE_BANK2_LENGTH;\r
85            } > flash\r
86 #endif\r
87 \r
88 #if defined(USE_FEE) || defined(CALIBRATION_ENABLED)\r
89 /* Place the rest of the code is in another flash partition that the calibration and fee banks. */\r
90 __FLS_PROG_START__ = 0x20000;   /* Must be aligned to a sector start. */\r
91 #else\r
92 \r
93 __FLS_PROG_START__ = 0; /* Must be aligned to a sector start. */\r
94 #endif\r
95 \r
96         .rcw __FLS_PROG_START__ : { *(.rcw) } > flash\r
97 \r
98 \r
99     .text :\r
100         {\r
101         *(.text .text.* .init .fini* .eini* .gnu.linkonce* .gnu.warning);\r
102         PROVIDE( btask_sup_matrix = .);\r
103         SORT(*)(.test_btask);\r
104         PROVIDE( etask_sup_matrix = .);\r
105         SORT(*)(.test_etask);\r
106         } > flash\r
107 \r
108         .fls_rom : {\r
109         __FLS_ERASE_ROM__ = .;\r
110         *(.fls_erase);\r
111         __FLS_WRITE_ROM__ = .;\r
112         *(.fls_write);\r
113         __FLS_END_ROM__ = .;\r
114         } > flash\r
115 \r
116 /* mpc5554, align 64K. mpc5516, 4k */\r
117     .exception_tbl ALIGN(0x10000) :\r
118     {\r
119       *(.isr_vector)\r
120     } > flash\r
121 \r
122         /* Read-only data section. */\r
123         .rodata :       { *(.rodata .rodata.* .gnu.linkonce.r.*) } > flash\r
124 \r
125         /* initialized read-only small data section. */\r
126         .sdata2 :       {\r
127                 _SDA2_BASE_ = .; /* r2 */\r
128                 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*);\r
129                 *(PPC.EMB.sdata2 .PPC.EMB.sbss2)\r
130         } > flash\r
131 \r
132 \r
133         /* uninitialized read-only small data section. */\r
134         .sbss2 : {\r
135                 *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*);\r
136                 __TEXT_END = .;\r
137                 . = . + ALIGN(8);\r
138         } > flash\r
139         \r
140 \r
141         .data : {\r
142                 . = . + ALIGN(4);\r
143                 __DATA_RAM = .; \r
144                 *(.data .data.* .gnu.linkonce.d.* .gnu.linkonce.r.* .eh_frame)\r
145         } > ram AT> flash\r
146 \r
147         .sdata : {\r
148                 . = . + ALIGN(4);\r
149                 __SDATA_START__ = .;\r
150                 _SDA_BASE_ = .;         /* r13 */\r
151                 *(.sdata .sdata.* .gnu.linkonce.s.*)\r
152                 *(PPC.EMB.sdata2 .PPC.EMB.sbss2)\r
153                 . = . + ALIGN(8);\r
154                 __DATA_END = .;\r
155         } > ram AT> flash\r
156 \r
157     .sbss :\r
158         {\r
159                 __SBSS_START__ = .;\r
160                 *(.sbss .sbss.* .scommon .gnu.linkonce.sb.* .t32_outport);\r
161                 __SBSS_END__ = .;\r
162                 _end = .;\r
163         } > ram\r
164 \r
165     .got2 ALIGN(0x10): \r
166     {\r
167         . = . + ALIGN(16);\r
168         *(.got2);       \r
169         . = . + ALIGN(8); \r
170     } > ram\r
171     .fixup : \r
172     { \r
173         . = . + ALIGN(16);\r
174         *(.fixup);\r
175         . = . + ALIGN(8); \r
176     }           > ram\r
177         .t32_outport ALIGN(0x10): \r
178         { \r
179                 *(.t32_outport); \r
180         }                       > ram\r
181         \r
182         .got : AT(ALIGN(LOADADDR(.sdata)+SIZEOF(.sdata),4)) \r
183         { \r
184                 *(.got.plt) *(.got) \r
185         } > ram\r
186         \r
187         .bss : AT(ADDR(.bss)) \r
188         { \r
189                 *(.bss .bss.* COMMON .gnu.linkonce.b.*);\r
190                 __BSS_END       = .; \r
191         }       > ram\r
192         .init_stack ALIGN(16) (NOLOAD) : \r
193         {       \r
194                 __SP_END        = .;\r
195                 . = . + 1000;   \r
196                 __SP_INIT       = .; \r
197         } > ram\r
198         \r
199         /* Fls RAM section */\r
200         .fls_ram ALIGN(16) (NOLOAD) : {\r
201                 __FLS_ERASE_RAM__ = .;\r
202                 . = . + SIZEOF(.fls_rom);\r
203         } > ram\r
204   .ctors          :\r
205   {\r
206     KEEP (*(SORT(.ctors.*)))\r
207   }\r
208 \r
209 .uninit ALIGN(0x10): { *(.winidea_port .ramlog .dem_eventmemory_pri) ; }                        > ram\r
210 \r
211         /* Always place last in RAM */\r
212         .heap ALIGN(0x4): {\r
213                 PROVIDE(_heap_start = .);\r
214         } > ram\r
215 \r
216 \r
217         __FLS_SIZE__ = SIZEOF(.fls_rom);\r
218         __FLS_WRITE_RAM__ =  __FLS_ERASE_RAM__ + (__FLS_WRITE_ROM__ - __FLS_ERASE_ROM__);\r
219 \r
220    /* Stabs debugging sections.  */\r
221   .stab          0 : { *(.stab) }\r
222   .stabstr       0 : { *(.stabstr) }\r
223   .stab.excl     0 : { *(.stab.excl) }\r
224   .stab.exclstr  0 : { *(.stab.exclstr) }\r
225   .stab.index    0 : { *(.stab.index) }\r
226   .stab.indexstr 0 : { *(.stab.indexstr) }\r
227   .comment       0 : { *(.comment) }\r
228   /* DWARF debug sections.\r
229      Symbols in the DWARF debugging sections are relative to the beginning\r
230      of the section so we begin them at 0.  */\r
231   /* DWARF 1 */\r
232   .debug          0 : { *(.debug) }\r
233   .line           0 : { *(.line) }\r
234   /* GNU DWARF 1 extensions */\r
235   .debug_srcinfo  0 : { *(.debug_srcinfo) }\r
236   .debug_sfnames  0 : { *(.debug_sfnames) }\r
237   /* DWARF 1.1 and DWARF 2 */\r
238   .debug_aranges  0 : { *(.debug_aranges) }\r
239   .debug_pubnames 0 : { *(.debug_pubnames) }\r
240   /* DWARF 2 */\r
241   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }\r
242   .debug_abbrev   0 : { *(.debug_abbrev) }\r
243   .debug_line     0 : { *(.debug_line) }\r
244   .debug_frame    0 : { *(.debug_frame) }\r
245   .debug_str      0 : { *(.debug_str) }\r
246   .debug_loc      0 : { *(.debug_loc) }\r
247   .debug_macinfo  0 : { *(.debug_macinfo) }\r
248   /* SGI/MIPS DWARF 2 extensions */\r
249   .debug_weaknames 0 : { *(.debug_weaknames) }\r
250   .debug_funcnames 0 : { *(.debug_funcnames) }\r
251   .debug_typenames 0 : { *(.debug_typenames) }\r
252   .debug_varnames  0 : { *(.debug_varnames) }\r
253 }\r
254 \r
255 _heap_end = ORIGIN(ram) + LENGTH(ram);\r
256 \r
257 __TEXT_START            = ADDR(.text);\r
258 __RAM_START             = ADDR(.sdata);\r
259 \r
260 __DATA_RAM              = ADDR(.data);\r
261 __DATA_ROM          = LOADADDR(.data);\r
262 /*__DATA_END            = ADDR(.sdata)+SIZEOF(.sdata);*/\r
263 /*__BSS_START           = ADDR(.sbss);*/\r
264 __BSS_START             = ADDR(.sbss);\r
265 \r
266 /* _SDA_BASE_ and _SDA2_BASE_ is defined in e500 ABI\r
267  * Some of the symbols below is used by eabi() that does interesting.\r
268  * Can't get rid of it even with no-eabi option\r
269  */\r
270 \r
271 /* __SBSS_END__                 = ADDR(.sbss) + SIZEOF(.sbss); */\r
272  __SDATA2_START__       = ADDR(.sdata2);\r
273  __SBSS2_END__          = ADDR(.sbss2) + SIZEOF(.sbss2);\r
274 __GOT_START__           = ADDR(.got);\r
275 __GOT_END__                     = ADDR(.got) + SIZEOF(.got);\r
276 __GOT2_START__          = ADDR(.got2);\r
277 __GOT2_END__            = ADDR(.got2) + SIZEOF(.got2);\r
278 __FIXUP_START__         = ADDR(.fixup);\r
279 __FIXUP_END__           = ADDR(.fixup) + SIZEOF(.fixup);\r
280 \r
281 __EXCEPT_START__        = 0x0;\r
282 __EXCEPT_END__          = 0x0;\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
307 \r