git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@146
4a8a32a2-be11-0410-ad9d-
d568d2c75423
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "; global & static initialisations\n");
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "; global & static initialisations\n");
fprintf (asmFile, "%s", iComments2);
+
+ /* Everywhere we generate a reference to the static_name area,
+ * (which is currently only here), we immediately follow it with a
+ * definition of the post_static_name area. This guarantees that
+ * the post_static_name area will immediately follow the static_name
+ * area.
+ */
fprintf (asmFile, "\t.area %s\n", port->mem.static_name); /* MOF */
fprintf (asmFile, "\t.area %s\n", port->mem.static_name); /* MOF */
+ fprintf (asmFile, "\t.area %s\n", port->mem.post_static_name);
+ fprintf (asmFile, "\t.area %s\n", port->mem.static_name);
+
if (mainf && mainf->fbody) {
fprintf (asmFile,"__sdcc_gsinit_startup:\n");
/* if external stack is specified then the
if (mainf && mainf->fbody) {
fprintf (asmFile,"__sdcc_gsinit_startup:\n");
/* if external stack is specified then the
copyFile (asmFile, statsg->oFile);
if (port->general.glue_up_main && mainf && mainf->fbody)
copyFile (asmFile, statsg->oFile);
if (port->general.glue_up_main && mainf && mainf->fbody)
+ {
+ /* This code is generated in the post-static area.
+ * This area is guaranteed to follow the static area
+ * by the ugly shucking and jiving about 20 lines ago.
+ */
+ fprintf(asmFile, "\t.area %s\n", port->mem.post_static_name);
fprintf (asmFile,"\tljmp\t__sdcc_program_startup\n");
fprintf (asmFile,"\tljmp\t__sdcc_program_startup\n");
/* copy over code */
fprintf (asmFile, "%s", iComments2);
/* copy over code */
fprintf (asmFile, "%s", iComments2);
"BSEG (BIT)",
"RSEG (DATA)",
"GSINIT (CODE)",
"BSEG (BIT)",
"RSEG (DATA)",
"GSINIT (CODE)",
+ "OSEG (OVR,DATA)",
+ "GSFINAL (CODE)"
const char *reg_name;
const char *static_name;
const char *overlay_name;
const char *reg_name;
const char *static_name;
const char *overlay_name;
+ const char *post_static_name;
} mem;
/* stack related information */
} mem;
/* stack related information */
"_BSEG",
"_RSEG",
"_GSINIT",
"_BSEG",
"_RSEG",
"_GSINIT",
+ "_OVERLAY",
+ "_GSFINAL"