void printsyms(Sym **symptr, long nsym) { int i, j, wid; Sym *s; char *cp; char path[512]; qsort(symptr, nsym, sizeof(*symptr), (void*)cmp); wid = 0; for (i=0; i<nsym; i++) { s = symptr[i]; if (s->value && wid == 0) wid = 8; else if (s->value >= 0x100000000LL && wid == 8) wid = 16; } for (i=0; i<nsym; i++) { s = symptr[i]; if (multifile && !hflag) Bprint(&bout, "%s:", filename); if (s->type == 'z') { fileelem(fnames, (uchar *) s->name, path, 512); cp = path; } else cp = s->name; if (Tflag) Bprint(&bout, "%8ux ", s->sig); if (s->value || s->type == 'a' || s->type == 'p') Bprint(&bout, "%*llux ", wid, s->value); else Bprint(&bout, "%*s ", wid, ""); if(Sflag) { vlong siz; siz = 0; for(j=i+1; j<nsym; j++) { if(symptr[j]->type != 'a' && symptr[j]->type != 'p') { siz = symptr[j]->value - s->value; break; } } if(siz > 0) Bprint(&bout, "%*llud ", wid, siz); } Bprint(&bout, "%c %s", s->type, cp); if(tflag && s->gotype) Bprint(&bout, " %*llux", wid, s->gotype); Bprint(&bout, "\n"); } }
void printsyms(Sym **symptr, int32_t nsym) { int i, wid; Sym *s; char *cp; char path[512]; if(!sflag) qsort(symptr, nsym, sizeof(*symptr), cmp); wid = 0; for (i=0; i<nsym; i++) { s = symptr[i]; if (s->value && wid == 0) wid = 8; else if (s->value >= 0x100000000LL && wid == 8) wid = 16; } for (i=0; i<nsym; i++) { s = symptr[i]; if (multifile && !hflag) Bprint(&bout, "%s:", filename); if (s->type == 'z') { fileelem(fnames, (uint8_t *) s->name, path, 512); cp = path; } else cp = s->name; if (Tflag) Bprint(&bout, "%8ux ", s->sig); if (s->value || s->type == 'a' || s->type == 'p') Bprint(&bout, "%*llux ", wid, s->value); else Bprint(&bout, "%*s ", wid, ""); Bprint(&bout, "%c %s\n", s->type, cp); } }
void printsyms(Sym **symptr, long nsym) { Sym *s; char *cp; char path[512]; if(!sflag) qsort(symptr, nsym, sizeof(*symptr), cmp); while (nsym-- > 0) { s = *symptr++; if (multifile && !hflag) Bprint(&bout, "%s:", filename); if (s->type == 'z') { fileelem(fnames, (uchar *) s->name, path, 512); cp = path; } else cp = s->name; if (s->value || s->type == 'a' || s->type == 'p') Bprint(&bout, "%8lux %c %s\n", s->value, s->type, cp); else Bprint(&bout, " %c %s\n", s->type, cp); } }