2 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
5 #include "Calibration_Settings.h"
\r
6 /* Undef sections/keywords */
\r
9 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
\r
10 OUTPUT_ARCH(powerpc)
\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
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
36 * PowerPC EABI special:
\r
43 #include "memory.ldf"
\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
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
57 #else /* CALIBRATION_INITIALIZED_RAM */
\r
58 /* when calibration isnt active only a flash area is needed. */
\r
59 .calibration CALIBRATION_FLS_START : {
\r
64 __CALIB_RAM_START = ADDR(.calibration);
\r
65 __CALIB_RAM_END = ADDR(.calibration) + SIZEOF(.calibration);
\r
66 __CALIB_ROM_START = LOADADDR(.calibration);
\r
68 /* failsafe to avoid trouble with defined calib variables if CALIBRATION_ENABLED is not set */
\r
72 ASSERT(SIZEOF(.calibration) == 0, ".calibration section used but CALIBRATION_ENABLED is undefined")
\r
73 #endif /* CALIBRATION_ENABLED */
\r
76 #if defined(USE_FEE)
\r
77 #include "Fee_Memory_Cfg.h"
\r
79 .fee_bank1 FEE_BANK1_OFFSET : {
\r
80 . = . + FEE_BANK1_LENGTH;
\r
83 .fee_bank2 FEE_BANK2_OFFSET : {
\r
84 . = . + FEE_BANK2_LENGTH;
\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
93 __FLS_PROG_START__ = 0; /* Must be aligned to a sector start. */
\r
96 .rcw __FLS_PROG_START__ : { *(.rcw) } > flash
\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
109 __FLS_ERASE_ROM__ = .;
\r
111 __FLS_WRITE_ROM__ = .;
\r
113 __FLS_END_ROM__ = .;
\r
116 /* mpc5554, align 64K. mpc5516, 4k */
\r
117 .exception_tbl ALIGN(0x10000) :
\r
122 /* Read-only data section. */
\r
123 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } > flash
\r
125 /* initialized read-only small data section. */
\r
127 _SDA2_BASE_ = .; /* r2 */
\r
128 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*);
\r
129 *(PPC.EMB.sdata2 .PPC.EMB.sbss2)
\r
133 /* uninitialized read-only small data section. */
\r
135 *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*);
\r
144 *(.data .data.* .gnu.linkonce.d.* .gnu.linkonce.r.* .eh_frame)
\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
159 __SBSS_START__ = .;
\r
160 *(.sbss .sbss.* .scommon .gnu.linkonce.sb.* .t32_outport);
\r
165 .got2 ALIGN(0x10):
\r
177 .t32_outport ALIGN(0x10):
\r
182 .got : AT(ALIGN(LOADADDR(.sdata)+SIZEOF(.sdata),4))
\r
184 *(.got.plt) *(.got)
\r
187 .bss : AT(ADDR(.bss))
\r
189 *(.bss .bss.* COMMON .gnu.linkonce.b.*);
\r
192 .init_stack ALIGN(16) (NOLOAD) :
\r
199 /* Fls RAM section */
\r
200 .fls_ram ALIGN(16) (NOLOAD) : {
\r
201 __FLS_ERASE_RAM__ = .;
\r
202 . = . + SIZEOF(.fls_rom);
\r
206 KEEP (*(SORT(.ctors.*)))
\r
209 .uninit ALIGN(0x10): { *(.winidea_port .ramlog .dem_eventmemory_pri) ; } > ram
\r
211 /* Always place last in RAM */
\r
212 .heap ALIGN(0x4): {
\r
213 PROVIDE(_heap_start = .);
\r
217 __FLS_SIZE__ = SIZEOF(.fls_rom);
\r
218 __FLS_WRITE_RAM__ = __FLS_ERASE_RAM__ + (__FLS_WRITE_ROM__ - __FLS_ERASE_ROM__);
\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
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
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
255 _heap_end = ORIGIN(ram) + LENGTH(ram);
\r
257 __TEXT_START = ADDR(.text);
\r
258 __RAM_START = ADDR(.sdata);
\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
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
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
281 __EXCEPT_START__ = 0x0;
\r
282 __EXCEPT_END__ = 0x0;
\r