/******************************************************************** * (c) ROBOSOFT (pierre@robosoft.fr) * * Example of linker script for non-SynDEx generated code. Need to * be modified according to your own application. -------------------------------------------------------------------- * Warning: this linker script is expected to link programs with * `libc.a' and `libm.a' built using Diab Data libraries! ********************************************************************/ STARTUP(crt0.o) MEMORY { ram1 : org = 0x3F9800, len = 26K /* MPC555 internal RAM */ ram : org = 0xFFF00000, len = 128K /* ROBOSOFT external RAM */ flash : org = 0x00000000, len = 448K /* mpc555 internal FLASH */ } ENTRY(start) /* first instruction to be executed after load completes */ /******************************************************************** * If you intend to create a SynDEx binary compatible file to allow * CAN bus download into MPC555 target, you have to tag, here, * the segments you need to include in this binary file. PT_LOAD is * the Program Header flag that will indicate this. If segments are * not needed you just have to omit them from the list. ********************************************************************/ PHDRS { ithandler PT_LOAD; fpu PT_LOAD; dec PT_LOAD; text PT_LOAD; data PT_LOAD; } /******************************************************************** * Note: in order to simplify the download process, each loadable * section is 8 bytes aligned. By this way, at download time, we will * send completly filled CAN frames (8 data bytes). It principally * avoid us to deal with bytes padding. ********************************************************************/ SECTIONS { /******************************************************* * Some sections provided by `.org' directives after * compilations under Diab Data compiler *******************************************************/ /******************************************************* * Section containing interrupt handler code *******************************************************/ .ithandler 0xFFF00500 : { *(.ithandler) . = ALIGN(8) ; } >ram :ithandler /******************************************************* * Section containing fpu exeption handler code *******************************************************/ .fpu 0xFFF00800 : { *(.fpu) . = ALIGN(8) ; } >ram :fpu /******************************************************* * Section containing decrementer exception handler code *******************************************************/ .dec 0xFFF00900 : { *(.dec) . = ALIGN(8) ; } >ram :dec /*************************************************** * .text section for code, constants, and init data ***************************************************/ .text 0xFFF02000 : { __IT_END = ABSOLUTE(.); *(.text) /* code */ *(.rodata) /* des commentaires seraient bienvenus */ *(.init) /* pour expliquer le role de ces 4 sections */ *(.fini) *(.eini) _etext = ALIGN(8) ; /* cleanup alignment for following ROMed data */ . = ALIGN(8) ; } >ram :text /* > flash */ /*************************************************** * .data section for initialized data * linked in ram1, but loaded after .text if ROMable ***************************************************/ .data 0x3F9800 : { /* AT(ABSOLUTE(_etext)) if ROMable) */ __DATA_ROM = ABSOLUTE(.) ; /* Needed for Diab Data library linking */ __DATA_START = ABSOLUTE(.) ; /* start of ROM>RAM transfer at startup */ __DATA_RAM = __DATA_START ; /* Needed for Diab Data library linking */ *(.data) . = ALIGN(8) ; /* cleanup alignment for following sdata */ __SDATA_START = ABSOLUTE(.) ; /* init value for r13, see gcc -mdata-sysv */ *(.sdata) /* "short" initialized data */ . = ALIGN(4) ; __DATA_END = ABSOLUTE(.) ; /* end of ROM>RAM transfer at startup */ __DATA_SIZE = ( __DATA_END - __DATA_START ) >> 2 ; /* words to transfer */ /* PP: use >>2 in spite of /4 cause of a ld possible bug. */ . = ALIGN(8) ; } >ram1 :data /********************************************************* * .bss section for uninitialized data, cleared at startup * WARNING: "short" sections .sdata and .sbss must be close * to each other; DO NOT change the relative order * of the .data and .bss sections in this file *********************************************************/ .bss (NOLOAD) : { . = ALIGN(8) ; __BSS_START = ABSOLUTE(.) ; *(.sbss) /* "short" uninitialized data */ *(.bss) *(COMMON) /* all other uninitialized data */ . = ALIGN(4) ; __BSS_END = ABSOLUTE(.) ; __HEAP_START = __BSS_END; /* Needed for Diab Data library linking */ __BSS_SIZE = ( __BSS_END - __BSS_START ) >> 2 ; /* words to clear */ /* PP: use >>2 in spite of /4 cause of a ld possible bug. */ } >ram1 /******************************************************* * .stack section for uninitialized stack of call-frames * Note: the stack is aligned on cache lines *******************************************************/ .stack (NOLOAD) : { __SP_END = ABSOLUTE(.) ; /* pour check_stack_overflow ? */ . += 6144 ; /* 192 stack frames of 32 bits each */ . = ALIGN(32); /* align stack-frames on cache lines */ __SP_INIT = ABSOLUTE(.) ; } >ram1 .sdata2 (NOLOAD) : { *(.sdata2) } >ram1 .got (NOLOAD) : { *(.got) __HEAP_END = ABSOLUTE(.) ; /* Needed for Diab Data library linking */ } >ram1 }