-#ifndef FLEXNAMES
- bwrite(sp->name, NCPS, symfile);
-#else FLEXNAMES
- len = strlen(sp->name);
- if (len != 0) {
- bwrite(&stroff, sizeof (stroff), symfile);
- stroff += len + 1;
- } else
- bwrite("\0\0\0\0", sizeof (stroff), symfile);
-#endif FLEXNAMES
- sp->type &= ~XFORW;
- bputc( ( (sp->ptype != 0) ? sp->ptype : sp->type ),
- symfile);
- /*
- * WATCH OUT. THIS DEPENDS THAT THE ALLOCATION OF
- * the four fields ptype, other, desc and value are
- * contiguous, which is compiler dependent.
- */
- bwrite((char *)&(sp->other),
- sizeof (sp->other)
- + sizeof (sp->desc)
- + sizeof (sp->value),
- symfile
- );
+ name = sp->s_name; /* save pointer */
+ /*
+ * the length of the symbol table string
+ * always includes the trailing null;
+ * blast the pointer to its a.out value.
+ */
+ if (sp->s_name && (sp->s_index = STRLEN(sp))){
+ sp->s_nmx = totalstr;
+ totalstr += sp->s_index;
+ } else {
+ sp->s_nmx = 0;
+ }
+ if (sp->s_ptype != 0)
+ sp->s_type = sp->s_ptype;
+ else
+ sp->s_type = (sp->s_type & (~XFORW));
+ if (readonlydata && (sp->s_type&~N_EXT) == N_DATA)
+ sp->s_type = N_TEXT | (sp->s_type & N_EXT);
+ bwrite((char *)&sp->s_nm, sizeof (struct nlist), symfile);
+ sp->s_name = name; /* restore pointer */