]> rtime.felk.cvut.cz Git - arc.git/blob - arch/ppc/mpc55xx/scripts/linkscript_gcc.ldf
Adc updated for 5668
[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 \r
147         .data : {\r
148                 __DATA_RAM = .; \r
149                 *(.data .data.* .gnu.linkonce.d.* .gnu.linkonce.r.* .eh_frame)\r
150                 . = ALIGN(0x10);\r
151         } > ram AT> flash\r
152 \r
153         .sdata : {\r
154                 __SDATA_START__ = .;\r
155                 _SDA_BASE_ = .;         /* r13 */\r
156                 *(.sdata .sdata.* .gnu.linkonce.s.*)\r
157                 *(PPC.EMB.sdata2 .PPC.EMB.sbss2)\r
158                 __DATA_END = .;\r
159         } > ram AT> flash\r
160 \r
161     .sbss :\r
162         {\r
163                 __SBSS_START__ = .;\r
164                 *(.sbss .sbss.* .scommon .gnu.linkonce.sb.* .t32_outport);\r
165                 __SBSS_END__ = .;\r
166                 _end = .;\r
167         } > ram\r
168 \r
169         .t32_outport ALIGN(0x10): \r
170         { \r
171                 *(.t32_outport); \r
172         }                       > ram\r
173                 \r
174         .bss (NOLOAD) :  \r
175         {\r
176                 *(.got2);\r
177                 *(.fixup);\r
178                 *(.bss .bss.* COMMON .gnu.linkonce.b.*);\r
179                 __BSS_END       = .; \r
180         }       > ram\r
181         \r
182         .init_stack ALIGN(16) (NOLOAD) : \r
183         {       \r
184                 __SP_END        = .;\r
185                 . = . + 1000;   \r
186                 __SP_INIT       = .; \r
187         } > ram\r
188         \r
189         /* Fls RAM section */\r
190         .fls_ram ALIGN(16) (NOLOAD) : {\r
191                 __FLS_ERASE_RAM__ = .;\r
192                 . = . + SIZEOF(.fls_rom);\r
193         } > ram\r
194   .ctors          :\r
195   {\r
196     KEEP (*(SORT(.ctors.*)))\r
197   }\r
198 \r
199 .uninit ALIGN(0x10) (NOLOAD) : { *(.winidea_port .ramlog .dem_eventmemory_pri) ; }                      > ram\r
200 \r
201         /* Always place last in RAM */\r
202         .heap ALIGN(0x4): {\r
203                 PROVIDE(_heap_start = .);\r
204         } > ram\r
205 \r
206 \r
207         __FLS_SIZE__ = SIZEOF(.fls_rom);\r
208         __FLS_WRITE_RAM__ =  __FLS_ERASE_RAM__ + (__FLS_WRITE_ROM__ - __FLS_ERASE_ROM__);\r
209 \r
210    /* Stabs debugging sections.  */\r
211   .stab          0 : { *(.stab) }\r
212   .stabstr       0 : { *(.stabstr) }\r
213   .stab.excl     0 : { *(.stab.excl) }\r
214   .stab.exclstr  0 : { *(.stab.exclstr) }\r
215   .stab.index    0 : { *(.stab.index) }\r
216   .stab.indexstr 0 : { *(.stab.indexstr) }\r
217   .comment       0 : { *(.comment) }\r
218   /* DWARF debug sections.\r
219      Symbols in the DWARF debugging sections are relative to the beginning\r
220      of the section so we begin them at 0.  */\r
221   /* DWARF 1 */\r
222   .debug          0 : { *(.debug) }\r
223   .line           0 : { *(.line) }\r
224   /* GNU DWARF 1 extensions */\r
225   .debug_srcinfo  0 : { *(.debug_srcinfo) }\r
226   .debug_sfnames  0 : { *(.debug_sfnames) }\r
227   /* DWARF 1.1 and DWARF 2 */\r
228   .debug_aranges  0 : { *(.debug_aranges) }\r
229   .debug_pubnames 0 : { *(.debug_pubnames) }\r
230   /* DWARF 2 */\r
231   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }\r
232   .debug_abbrev   0 : { *(.debug_abbrev) }\r
233   .debug_line     0 : { *(.debug_line) }\r
234   .debug_frame    0 : { *(.debug_frame) }\r
235   .debug_str      0 : { *(.debug_str) }\r
236   .debug_loc      0 : { *(.debug_loc) }\r
237   .debug_macinfo  0 : { *(.debug_macinfo) }\r
238   /* SGI/MIPS DWARF 2 extensions */\r
239   .debug_weaknames 0 : { *(.debug_weaknames) }\r
240   .debug_funcnames 0 : { *(.debug_funcnames) }\r
241   .debug_typenames 0 : { *(.debug_typenames) }\r
242   .debug_varnames  0 : { *(.debug_varnames) }\r
243 }\r
244 \r
245 _heap_end = ORIGIN(ram) + LENGTH(ram);\r
246 \r
247 __TEXT_START            = ADDR(.text);\r
248 __RAM_START             = ADDR(.sdata);\r
249 \r
250 __DATA_RAM              = ADDR(.data);\r
251 __DATA_ROM          = LOADADDR(.data);\r
252 /*__DATA_END            = ADDR(.sdata)+SIZEOF(.sdata);*/\r
253 /*__BSS_START           = ADDR(.sbss);*/\r
254 __BSS_START             = ADDR(.sbss);\r
255 \r
256 /* _SDA_BASE_ and _SDA2_BASE_ is defined in e500 ABI\r
257  * Some of the symbols below is used by eabi() that does interesting.\r
258  * Can't get rid of it even with no-eabi option\r
259  */\r
260 \r
261 /* __SBSS_END__                 = ADDR(.sbss) + SIZEOF(.sbss); */\r
262  __SDATA2_START__       = ADDR(.sdata2);\r
263  __SBSS2_END__          = ADDR(.sbss2) + SIZEOF(.sbss2);\r
264 //__GOT_START__         = ADDR(.got);\r
265 //__GOT_END__                   = ADDR(.got) + SIZEOF(.got);\r
266 //__GOT2_START__                = ADDR(.got2);\r
267 //__GOT2_END__          = ADDR(.got2) + SIZEOF(.got2);\r
268 //__FIXUP_START__               = ADDR(.fixup);\r
269 //__FIXUP_END__         = ADDR(.fixup) + SIZEOF(.fixup);\r
270 \r
271 __EXCEPT_START__        = 0x0;\r
272 __EXCEPT_END__          = 0x0;\r
273 \r
274 \r
275 \r
276 \r
277 \r
278 \r
279 \r
280 \r
281 \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