AnsweredAssumed Answered

.init appears twice in PLACEMENT block

Question asked by SP Lee on Nov 26, 2010
Latest reply on Nov 29, 2010 by Stefan Craciun


I have an linker error for the following, after I inserted in the prm file .init and assigned it to the ROM segment.

The error is: ".init appears twice in PLACEMENT block".

I thought in the prm file .init only appears once.

Can anybody explain why? 


/* This is a linker parameter file for the mc9s08jm32 */NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */    Z_RAM                    =  READ_WRITE   0x00B0 TO 0x00FF;    RAM                      =  READ_WRITE   0x0100 TO 0x08AF;    RAM1                     =  READ_WRITE   0x1860 TO 0x195F;    ROM                      =  READ_ONLY    0x8000 TO 0xFFAD;    ROM1                     =  READ_ONLY    0xFFC0 TO 0xFFC3; /* INTVECTS                 =  READ_ONLY    0xFFC4 TO 0xFFFF; Reserved for Interrupt Vectors */ENDPLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */    DEFAULT_RAM                         /* non-zero page variables */                                        INTO  RAM,RAM1;    .init,    SP_section,    _PRESTART,                          /* startup code */    STARTUP,                            /* startup data structures */    ROM_VAR,                            /* constant variables */    STRINGS,                            /* string literals */    VIRTUAL_TABLE_SEGMENT,              /* C++ virtual table segment */    DEFAULT_ROM,    COPY                                /* copy down information: how to initialize variables */                                        INTO  ROM; /* ,ROM1: To use "ROM1" as well, pass the option -OnB=b to the compiler */    _DATA_ZEROPAGE,                     /* zero page variables */    MY_ZEROPAGE                         INTO  Z_RAM;ENDSTACKSIZE 0x50VECTOR 0 _Startup /* Reset vector: this is the default entry point for an application. */