diff 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
line wrap: on
line diff
--- a/ticoff/symtab.c	Wed Mar 26 02:00:44 2014 +0000
+++ b/ticoff/symtab.c	Wed Mar 26 02:44:19 2014 +0000
@@ -72,8 +72,8 @@
 		sym = symtab[n];
 		if (!sym)
 			continue;
-		if (sym->scnum >= 1 && (unsigned)sym->scnum <= nsections)
-			sec = sections[sym->scnum - 1].name;
+		if (sym->section)
+			sec = sym->section->name;
 		else {
 			sprintf(secstr, "%d", sym->scnum);
 			sec = secstr;
@@ -115,7 +115,7 @@
 			printf("%s defines:\n\n", heading);
 			defs_started = 1;
 		}
-		printf("%s (%s)\n", sym->name, sections[sym->scnum - 1].name);
+		printf("%s (%s)\n", sym->name, sym->section->name);
 	}
 	if (defs_started)
 		putchar('\n');