#define S_UND 0x0000 /* undefined item */
#define S_ABS 0x0001 /* absolute item */
#define S_MIN 0x0002 /* first user section */
-#define S_MAX S_TYP /* last user section */
+#define S_MAX (S_TYP-1) /* last user section */
+#define S_CRS S_TYP /* reference to other namelist item */
.fi
.PP
The fields of this structure have the following purpose:
fprintf(stderr, "%s: ", progname);
if (archname && modulname)
- fprintf(stderr, "%s(%s): ", archname, modulname);
+ fprintf(stderr, "%s(%.14s): ", archname, modulname);
else if (archname)
fprintf(stderr, "%s: ", archname);
else if (modulname)
- fprintf(stderr, "%s: ", modulname);
+ fprintf(stderr, "%.14s: ", modulname);
fprintf(stderr, format, a1, a2, a3, a4);
if (tail) fprintf(stderr, " (%s)\n", tail);
else putc('\n', stderr);
name.on_foff += charindex - charoff;
}
namerelocate(&name);
+ if ((name.on_type & S_TYP) == S_CRS) {
+ name.on_valu += charindex - charoff;
+ name.on_valu = savechar(ALLOGCHR, (ind_t)name.on_valu);
+ }
if (name.on_type & S_EXT) {
getexternal(&name);
} else {
register struct outname *name;
{
register int type = name->on_type;
+ register int sct = type & S_TYP;
- if ((type & S_TYP) == S_UND || (type & S_TYP) == S_ABS)
+ if (sct == S_UND || sct == S_ABS || sct == S_CRS)
return;
if (type & S_COM) {
if ( ! (type&S_EXT) ) fatal("local commons should be handled by the assembler") ;
if (old == (struct outname *)0) {
NGlobals++;
entername(name, h);
+ if (ISUNDEFINED(name)) {
+ verbose("requires %s", string, 0, 0, 0);
+ }
} else if (!ISUNDEFINED(name)) {
if (ISUNDEFINED(old)) {
name->on_mptr = string; /* Just for convenience. */
#include "scan.h"
extern bool incore;
+extern ushort NLocals;
extern int flagword;
+extern struct outname *searchname();
static adjust_names();
static handle_relos();
{
register int cnt;
register long charoff;
+ struct outname *base = name;
cnt = head->oh_nname;
charoff = OFF_CHAR(*head);
name->on_mptr = chars + (ind_t)(name->on_foff - charoff);
name++;
}
+ if (! incore) {
+ do_crs(base, head->oh_nname);
+ }
+}
+
+do_crs(base, count)
+ struct outname *base;
+ unsigned short count;
+{
+ register struct outname *name = base;
+
+ while (count--) {
+ if ((name->on_type & S_TYP) == S_CRS) {
+ char *s;
+ struct outname *p;
+
+ s = address(ALLOGCHR, (ind_t) name->on_valu);
+ p = searchname(s, hash(s));
+
+ if (flagword & RFLAG) {
+ name->on_valu = NLocals + (p -
+ (struct outname *)
+ address(ALLOGLOB, (ind_t) 0));
+ }
+ else {
+ name->on_valu = p->on_valu;
+ name->on_type &= ~S_TYP;
+ name->on_type |= (p->on_type & S_TYP);
+ }
+ }
+ name++;
+ }
}
/*
register int type = name->on_type & S_TYP;
register int sectindex = type - S_MIN;
- if (type == S_UND || type == S_ABS)
+ if (type == S_UND || type == S_ABS || type == S_CRS)
return;
if (name->on_type & S_COM)
return;
* At the end of the global area we have put the section names.
*/
if (!(flagword & SFLAG)) {
+ do_crs((struct outname *)mems[ALLOLOCL].mem_base, NLocals);
namecpy((struct outname *)mems[ALLOLOCL].mem_base,
NLocals,
offchar