From: johanknol Date: Mon, 10 Dec 2001 13:57:23 +0000 (+0000) Subject: fixed bug #482168 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=be3db2fc38c037d646f1f32573765d7c154da1c3;p=fw%2Fsdcc fixed bug #482168 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1671 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/as/mcs51/asmain.c b/as/mcs51/asmain.c index bb219428..79934663 100644 --- a/as/mcs51/asmain.c +++ b/as/mcs51/asmain.c @@ -843,10 +843,6 @@ loop: if ((ap = alookup(id)) != NULL) { if (uaf && uf != ap->a_flag) err('m'); - if (ap->a_flag & A_OVR) { - ap->a_size = 0; - ap->a_fuzz=0; - } } else { ap = (struct area *) new (sizeof(struct area)); ap->a_ap = areap; @@ -1114,11 +1110,26 @@ register struct area *nap; register struct area *oap; oap = dot.s_area; + /* fprintf (stderr, "%s dot.s_area->a_size: %d dot.s_addr: %d\n", + oap->a_id, dot.s_area->a_size, dot.s_addr); */ oap->a_fuzz = fuzz; - oap->a_size = dot.s_addr; - fuzz = nap->a_fuzz; + if (oap->a_flag & A_OVR) { + // the size of an overlay is the biggest size encountered + if (oap->a_size < dot.s_addr) { + oap->a_size = dot.s_addr; + } + } else { + oap->a_size = dot.s_addr; + } + if (nap->a_flag & A_OVR) { + // a new overlay starts at 0, no fuzz + dot.s_addr = 0; + fuzz = 0; + } else { + dot.s_addr = nap->a_size; + fuzz = nap->a_fuzz; + } dot.s_area = nap; - dot.s_addr = nap->a_size; outall(); } diff --git a/src/SDCCglue.c b/src/SDCCglue.c index 209f5d8f..4895a3e0 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -1226,11 +1226,15 @@ emitOverlay (FILE * afile) if (elementsInSet (ovrset)) { +#if 0 /* this dummy area is used to fool the assembler otherwise the assembler will append each of these declarations into one chunk and will not overlay sad but true */ fprintf (afile, "\t.area _DUMMY\n"); +#else + /* not anymore since asmain.c:1.13 */ +#endif /* output the area informtion */ fprintf (afile, "\t.area\t%s\n", port->mem.overlay_name); /* MOF */ }