/* * Copyright (C) 2009 ArcCore AB */ #include "Calibration_Settings.h" /* Undef sections/keywords */ #undef PPC OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") OUTPUT_ARCH(powerpc) ENTRY(_start) /* * _idata - Start of .data in flash * _data - start address of .data in RAM * _edata - end address of .data in RAM * _bss - start address of .bss * _ebss - end address of .bss * _etext - end of .text * _end - End of something.... * * More stuff: * * _arc_heap_start * _arc_heap_end * _arc_stack * * Dwarf stuff: (same as Dwarf3 .debug_frame? ) * eh_frame_hdr (C++ only? unwind info for C++ exceptions?) * eh_frame (C++ only?) * * Exception table: * _exc_frame_start * _exc_frame_end * * PowerPC EABI special: * _SDA2_BASE_ * _SDA_BASE */ MEMORY { #include "memory.ldf" } SECTIONS { #if 0 /* __CALIB_RAM_START, __CALIB_RAM_END, __CALIB_ROM_START are needed by the a2l and the rte generator. CALIBRATION_ENABLED, CALIBRATION_INITIALIZED_RAM, CALIBRATION_FLS_START are generated by rte */ #if defined(CALIBRATION_ENABLED) #if defined(CALIBRATION_INITIALIZED_RAM) /* when calibration is active a flash and ram area is needed. the rte will copy the calibration area from flash to ram. */ .calibration : AT(CALIBRATION_FLS_START) { *(.calibration) } > ram #else /* CALIBRATION_INITIALIZED_RAM */ /* when calibration isnt active only a flash area is needed. */ .calibration CALIBRATION_FLS_START : { *(.calibration) } > flash #endif __CALIB_RAM_START = ADDR(.calibration); __CALIB_RAM_END = ADDR(.calibration) + SIZEOF(.calibration); __CALIB_ROM_START = LOADADDR(.calibration); #else /* failsafe to avoid trouble with defined calib variables if CALIBRATION_ENABLED is not set */ .calibration : { *(.calibration) } > flash ASSERT(SIZEOF(.calibration) == 0, ".calibration section used but CALIBRATION_ENABLED is undefined") #endif /* CALIBRATION_ENABLED */ #if defined(USE_FEE) #include "Fee_Memory_Cfg.h" .fee_bank1 FEE_BANK1_OFFSET : { . = . + FEE_BANK1_LENGTH; } > flash .fee_bank2 FEE_BANK2_OFFSET : { . = . + FEE_BANK2_LENGTH; } > flash #endif #if defined(USE_FEE) || defined(CALIBRATION_ENABLED) /* Place the rest of the code is in another flash partition that the calibration and fee banks. */ __FLS_PROG_START__ = 0x20000; /* Must be aligned to a sector start. */ #else __FLS_PROG_START__ = 0; /* Must be aligned to a sector start. */ #endif #if !defined(CFG_BOOT) .rcw __FLS_PROG_START__ : { *(.rcw) } > flash #endif #endif .text : { crt0.o(.text); *(.text .text.* .init .fini* .eini* .gnu.linkonce* .gnu.warning); PROVIDE( btask_sup_matrix = .); SORT(*)(.test_btask); PROVIDE( etask_sup_matrix = .); SORT(*)(.test_etask); } > flash .fls_rom : { __FLS_ERASE_ROM__ = .; *(.fls_erase); __FLS_WRITE_ROM__ = .; *(.fls_write); __FLS_END_ROM__ = .; } > flash /* mpc5554, align 64K. mpc5516, 4k */ .exception_tbl ALIGN(0x10000) : { *(.isr_vector) } > flash /* Read-only data section. */ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*); *(.got.plt) *(.got) } > flash /* initialized read-only small data section. */ .sdata2 : { _SDA2_BASE_ = .; /* r2 */ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*); *(PPC.EMB.sdata2 .PPC.EMB.sbss2) . = ALIGN(0x10); } > flash /* uninitialized read-only small data section. */ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*); __TEXT_END = .; } > flash #if defined(CFG_MPC5516) .McuE_LowPowerRecoverFlash 0x000ff000: { *(.lowpower_text); } .lowpower_vector 0x000ffffc: { *(.lowpower_vector); } #endif .data : { __DATA_RAM = .; *(.data .data.* .gnu.linkonce.d.* .gnu.linkonce.r.* .eh_frame) . = ALIGN(0x10); } > ram AT> flash .sdata : { __SDATA_START__ = .; _SDA_BASE_ = .; /* r13 */ *(.sdata .sdata.* .gnu.linkonce.s.*) *(PPC.EMB.sdata2 .PPC.EMB.sbss2) __DATA_END = .; } > ram AT> flash .sbss : { __SBSS_START__ = .; *(.sbss .sbss.* .scommon .gnu.linkonce.sb.* .t32_outport); __SBSS_END__ = .; _end = .; } > ram .t32_outport ALIGN(0x10): { *(.t32_outport); } > ram .bss (NOLOAD) : { *(.got2); *(.fixup); *(.bss .bss.* COMMON .gnu.linkonce.b.*); __BSS_END = .; } > ram .init_stack ALIGN(16) (NOLOAD) : { __SP_END = .; . = . + 1000; __SP_INIT = .; } > ram /* Fls RAM section */ .fls_ram ALIGN(16) (NOLOAD) : { __FLS_ERASE_RAM__ = .; . = . + SIZEOF(.fls_rom); } > ram .ctors : { KEEP (*(SORT(.ctors.*))) } .uninit ALIGN(0x10) (NOLOAD) : { *(.winidea_port .ramlog .dem_eventmemory_pri) ; } > ram /* Always place last in RAM */ .heap ALIGN(0x4): { PROVIDE(_heap_start = .); } > ram __FLS_SIZE__ = SIZEOF(.fls_rom); __FLS_WRITE_RAM__ = __FLS_ERASE_RAM__ + (__FLS_WRITE_ROM__ - __FLS_ERASE_ROM__); /* Stabs debugging sections. */ .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 : { *(.stab.excl) } .stab.exclstr 0 : { *(.stab.exclstr) } .stab.index 0 : { *(.stab.index) } .stab.indexstr 0 : { *(.stab.indexstr) } .comment 0 : { *(.comment) } /* DWARF debug sections. Symbols in the DWARF debugging sections are relative to the beginning of the section so we begin them at 0. */ /* DWARF 1 */ .debug 0 : { *(.debug) } .line 0 : { *(.line) } /* GNU DWARF 1 extensions */ .debug_srcinfo 0 : { *(.debug_srcinfo) } .debug_sfnames 0 : { *(.debug_sfnames) } /* DWARF 1.1 and DWARF 2 */ .debug_aranges 0 : { *(.debug_aranges) } .debug_pubnames 0 : { *(.debug_pubnames) } /* DWARF 2 */ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_abbrev 0 : { *(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame 0 : { *(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 : { *(.debug_loc) } .debug_macinfo 0 : { *(.debug_macinfo) } /* SGI/MIPS DWARF 2 extensions */ .debug_weaknames 0 : { *(.debug_weaknames) } .debug_funcnames 0 : { *(.debug_funcnames) } .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } } _heap_end = ORIGIN(ram) + LENGTH(ram); __TEXT_START = ADDR(.text); __RAM_START = ADDR(.sdata); __DATA_RAM = ADDR(.data); __DATA_ROM = LOADADDR(.data); /*__DATA_END = ADDR(.sdata)+SIZEOF(.sdata);*/ /*__BSS_START = ADDR(.sbss);*/ __BSS_START = ADDR(.sbss); /* _SDA_BASE_ and _SDA2_BASE_ is defined in e500 ABI * Some of the symbols below is used by eabi() that does interesting. * Can't get rid of it even with no-eabi option */ /* __SBSS_END__ = ADDR(.sbss) + SIZEOF(.sbss); */ __SDATA2_START__ = ADDR(.sdata2); __SBSS2_END__ = ADDR(.sbss2) + SIZEOF(.sbss2); //__GOT_START__ = ADDR(.got); //__GOT_END__ = ADDR(.got) + SIZEOF(.got); //__GOT2_START__ = ADDR(.got2); //__GOT2_END__ = ADDR(.got2) + SIZEOF(.got2); //__FIXUP_START__ = ADDR(.fixup); //__FIXUP_END__ = ADDR(.fixup) + SIZEOF(.fixup); __EXCEPT_START__ = 0x0; __EXCEPT_END__ = 0x0;