extern int Label, label_waiting;
register struct outname *nm = &symbol_table[Label];
- if (label_waiting && (nm->on_type & S_EXT)) {
+ if (label_waiting) {
+ /* If possible, generate a common. Local commons must
+ be delt with later.
+ */
nm->on_type |= S_COM | (S_MIN+SEGBSS);
if (n > nm->on_valu) {
nm->on_valu = n;
return;
}
switchseg(SEGBSS);
- dump_label();
bss(n);
}
#include <alloc.h>
#include <out.h>
#include "mach.h"
-#include "data.h"
+#include "back.h"
static reduce_name_table();
rp++;
}
for (i = 0; i < nname; i++) {
- symbol_table[i].on_type &= ~S_NEEDED;
+ register struct outname *np = &symbol_table[i];
+
+ np->on_type &= ~S_NEEDED;
+ if ((np->on_type & S_COM) && ! (np->on_type & S_EXT)) {
+ long sz = np->on_valu;
+
+ switchseg(SEGBSS);
+ align_word();
+ np->on_type &= (~S_COM);
+ np->on_valu = cur_value();
+ bss(sz);
+ }
if (diff_index[i] && diff_index[i] == diff_index[i-1]) {
- symbol_table[i - diff_index[i]] = symbol_table[i];
+ symbol_table[i - diff_index[i]] = *np;
}
}
nname -= diff_index[nname - 1];
register struct outname *np = &symbol_table[rp->or_nami];
int olddiff = diff;
+ if ((np->on_type & S_COM) && ! (np->on_type & S_EXT)) {
+ long sz = np->on_valu;
+
+ switchseg(SEGBSS);
+ align_word();
+ np->on_type &= (~S_COM);
+ np->on_valu = cur_value();
+ bss(sz);
+ }
if ( np->on_valu != -1 && ! (np->on_type & S_COM)) {
register long oldval,newval;
register char *sect;