comparison ticoff/symtab.c @ 80:da103b9377e3

tiobjd: preparation for symbol sorting
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Wed, 26 Mar 2014 02:44:19 +0000
parents 8f4996bff904
children 192da19c7506
comparison
equal deleted inserted replaced
79:8f4996bff904 80:da103b9377e3
70 "Num", "Name", "Type", "Class", "Section", "Value"); 70 "Num", "Name", "Type", "Class", "Section", "Value");
71 for (n = 0; n < nsymtab; n++) { 71 for (n = 0; n < nsymtab; n++) {
72 sym = symtab[n]; 72 sym = symtab[n];
73 if (!sym) 73 if (!sym)
74 continue; 74 continue;
75 if (sym->scnum >= 1 && (unsigned)sym->scnum <= nsections) 75 if (sym->section)
76 sec = sections[sym->scnum - 1].name; 76 sec = sym->section->name;
77 else { 77 else {
78 sprintf(secstr, "%d", sym->scnum); 78 sprintf(secstr, "%d", sym->scnum);
79 sec = secstr; 79 sec = secstr;
80 } 80 }
81 class = storage_class_to_string(sym->class, classbuf); 81 class = storage_class_to_string(sym->class, classbuf);
113 } 113 }
114 if (!defs_started) { 114 if (!defs_started) {
115 printf("%s defines:\n\n", heading); 115 printf("%s defines:\n\n", heading);
116 defs_started = 1; 116 defs_started = 1;
117 } 117 }
118 printf("%s (%s)\n", sym->name, sections[sym->scnum - 1].name); 118 printf("%s (%s)\n", sym->name, sym->section->name);
119 } 119 }
120 if (defs_started) 120 if (defs_started)
121 putchar('\n'); 121 putchar('\n');
122 if (first_extern < 0) 122 if (first_extern < 0)
123 return(0); 123 return(0);