[BACK]Return to aout.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / gprof

Diff for /src/usr.bin/gprof/Attic/aout.c between version 1.2 and 1.3

version 1.2, 2003/06/03 02:56:08 version 1.3, 2007/09/10 14:29:53
Line 87 
Line 87 
 static void  static void
 getstrtab(FILE *nfile, const char *filename)  getstrtab(FILE *nfile, const char *filename)
 {  {
         fseek(nfile, (long)(N_SYMOFF(xbuf) + xbuf.a_syms), 0);          fseek(nfile, (long)(N_SYMOFF(xbuf) + xbuf.a_syms), SEEK_SET);
         if (fread(&ssiz, sizeof (ssiz), 1, nfile) == 0)          if (fread(&ssiz, sizeof (ssiz), 1, nfile) == 0)
                 errx(1, "%s: no string table (old format?)" , filename );                  errx(1, "%s: no string table (old format?)" , filename );
         strtab = calloc(ssiz, 1);          strtab = calloc(ssiz, 1);
Line 109 
Line 109 
         long i;          long i;
   
         /* pass1 - count symbols */          /* pass1 - count symbols */
         fseek(nfile, (long)N_SYMOFF(xbuf), 0);          fseek(nfile, (long)N_SYMOFF(xbuf), SEEK_SET);
         nname = 0;          nname = 0;
         for (i = xbuf.a_syms; i > 0; i -= sizeof(struct nlist)) {          for (i = xbuf.a_syms; i > 0; i -= sizeof(struct nlist)) {
                 fread(&nbuf, sizeof(nbuf), 1, nfile);                  fread(&nbuf, sizeof(nbuf), 1, nfile);
Line 126 
Line 126 
                     askfor * sizeof(nltype));                      askfor * sizeof(nltype));
   
         /* pass2 - read symbols */          /* pass2 - read symbols */
         fseek(nfile, (long)N_SYMOFF(xbuf), 0);          fseek(nfile, (long)N_SYMOFF(xbuf), SEEK_SET);
         npe = nl;          npe = nl;
         nname = 0;          nname = 0;
         for (i = xbuf.a_syms; i > 0; i -= sizeof(struct nlist)) {          for (i = xbuf.a_syms; i > 0; i -= sizeof(struct nlist)) {
Line 168 
Line 168 
                   xbuf.a_text);                    xbuf.a_text);
                 return;                  return;
         }          }
         (void)fseek(nfile, N_TXTOFF(xbuf), 0);          (void)fseek(nfile, N_TXTOFF(xbuf), SEEK_SET);
         if (fread(textspace, 1, xbuf.a_text, nfile) != xbuf.a_text ) {          if (fread(textspace, 1, xbuf.a_text, nfile) != xbuf.a_text ) {
                 warnx("couldn't read text space: can't do -c");                  warnx("couldn't read text space: can't do -c");
                 free(textspace);                  free(textspace);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3