+ // Run through all symbols (now on the .sdecl list) and assign numbers to
+ // them. We also pick which symbols should be global or not here.
+ for(SYM * sy=sdecl; sy!=NULL; sy=sy->sdecl)
+ {
+ // Export or import external references, and export COMMON blocks.
+ if ((sy->stype == LABEL)
+ && ((sy->sattr & (GLOBAL | DEFINED)) == (GLOBAL | DEFINED)
+ || (sy->sattr & (GLOBAL | REFERENCED)) == (GLOBAL | REFERENCED))
+ || (sy->sattr & COMMON))
+ {
+ sy->senv = scount++;
+
+ if (buf != NULL)
+ buf = construct(buf, sy, 1);
+ }
+ // Export vanilla labels (but don't make them global). An exception is
+ // made for equates, which are not exported unless they are referenced.
+ else if (sy->stype == LABEL && lsym_flag
+ && (sy->sattr & (DEFINED | REFERENCED)) != 0
+ && (!as68_flag || *sy->sname != 'L'))
+ {
+ sy->senv = scount++;
+
+ if (buf != NULL)
+ buf = construct(buf, sy, 0);
+ }
+ }
+
+ return scount;