From: johanknol Date: Mon, 17 Dec 2001 17:41:43 +0000 (+0000) Subject: mmmm, that could be better X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=0c3af8ae3718db7a27cd44e88d5273b5e86c6f5f;p=fw%2Fsdcc mmmm, that could be better git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1688 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCglue.c b/src/SDCCglue.c index a0f98225..e100f5bb 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -239,7 +239,7 @@ emitRegularMap (memmap * map, bool addPublics, bool arFlag) sprintf (newSym->name, "_xinit_%s", sym->name); sprintf (newSym->rname,"_xinit_%s", sym->rname); SPEC_CONST(newSym->etype)=1; - SPEC_STAT(newSym->etype)=1; + //SPEC_STAT(newSym->etype)=1; addSym (SymbolTab, newSym, newSym->name, 0, 0, 1); // add it to the "XINIT (CODE)" segment diff --git a/src/SDCCmem.c b/src/SDCCmem.c index 7e6c60b7..afbcdec2 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -264,11 +264,6 @@ void allocIntoSeg (symbol * sym) { memmap *segment = SPEC_OCLS (sym->etype); - // should we move this to the initialized data segment? - if (port->genXINIT && segment==xdata && - sym->ival && sym->level==0 && !SPEC_ABSA(sym->etype)) { - segment=SPEC_OCLS(sym->etype)=xidata; - } addSet (&segment->syms, sym); } @@ -394,6 +389,12 @@ allocGlobal (symbol * sym) if (SPEC_SCLS (sym->etype) == S_XDATA) { SPEC_OCLS (sym->etype) = xdata; + // should we move this to the initialized data segment? + if (port->genXINIT && + sym->ival && (sym->level==0) && !SPEC_ABSA(sym->etype)) { + SPEC_OCLS(sym->etype)=xidata; + addSet(&xidata->syms, sym); + } allocIntoSeg (sym); return; }