fprintf (out, "%s$%d$%d", sym->name, sym->level, sym->block);
}
- /* if it has an absolute address */
- if (SPEC_ABSA (sym->etype))
+ /* if it has an absolute address and no initializer */
+ if (SPEC_ABSA (sym->etype) && !sym->ival)
{
if (options.debug)
fprintf (out, " == 0x%04x\n", SPEC_ADDR (sym->etype));
/* if it has an initial value */
if (sym->ival)
{
+ if (SPEC_ABSA (sym->etype))
+ {
+ tfprintf (out, "\t!org\n", SPEC_ADDR (sym->etype));
+ }
fprintf (out, "%s:\n", sym->rname);
noAlloc++;
resolveIvalSym (sym->ival, sym->type);
tfprintf (code->oFile, "\t!area\n", xinit->sname);
emitStaticSeg (xinit, code->oFile);
}
+ tfprintf (code->oFile, "\t!area\n", c_abs->sname);
+ emitStaticSeg (c_abs, code->oFile);
inInitMode--;
}
/** Creates a temporary file with unique file name
Scans, in order:
- TMP, TEMP, TMPDIR env. variables
- - if Un*x system: /usr/tmp and /tmp
+ - if Un*x system: /tmp and /var/tmp
- root directory using mkstemp() if available
- default location using tempnam()
*/
}
#else
{
- /* try with /usr/tmp and /tmp on Un*x systems */
+ /* try with /tmp and /var/tmp on Un*x systems */
struct stat statbuf;
if (tmpdir == NULL) {
- if (stat("/usr/tmp", &statbuf) != -1)
- tmpdir = "/usr/tmp";
- else if (stat("/tmp", &statbuf) != -1)
+ if (stat("/tmp", &statbuf) != -1)
tmpdir = "/tmp";
+ else if (stat("/var/tmp", &statbuf) != -1)
+ tmpdir = "/var/tmp";
}
}
#endif