+ if (symp==NULL)
+ symp = (struct nlist *)malloc(sizeof(struct nlist));
+ else {
+ symp = (struct nlist *)realloc(symp, (i+1)*sizeof(struct nlist));
+ }
+ if (symp == NULL) {
+ fprintf(stderr, "nm: out of memory on %s\n", *argv);
+ exit(2);
+ }
+ symp[i++] = sym;
+ }
+ if (nosort_flg==0)
+ qsort(symp, i, sizeof(struct nlist), compare);
+ if ((arch_flg || narg>1) && prep_flg==0)
+ printf("\n%s:\n", SELECT);
+ for (n=0; n<i; n++) {
+ if (prep_flg) {
+ if (arch_flg)
+ printf("%s:", *argv);
+ printf("%s:", SELECT);
+ }
+ c = symp[n].n_type;
+
+ if (c & STABTYPE) {
+ printf("%08x - %-8.8s %02x %02x %04x\n",
+ symp[n].n_value,
+ symp[n].n_name,
+ symp[n].n_type & 0xff,
+ symp[n].n_other & 0xff,
+ symp[n].n_desc & 0xffff);
+ continue;
+ }
+ switch (c&(N_TYPE-N_EXT)) {