changeset 142:ed533d469838

tiobjd: show symtab aux entries
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 28 Apr 2014 04:51:35 +0000
parents db16876a2684
children fbdb7686a9e9
files leo-obj/tool/basics.c leo-obj/tool/symtab.c
diffstat 2 files changed, 23 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/leo-obj/tool/basics.c	Sun Apr 27 18:07:55 2014 +0000
+++ b/leo-obj/tool/basics.c	Mon Apr 28 04:51:35 2014 +0000
@@ -49,11 +49,24 @@
 	exit(0);
 }
 
-cmd_symtab()
+cmd_symtab(argc, argv)
+	char **argv;
 {
+	int c, show_aux = 0;
+
+	while ((c = getopt(argc, argv, "a")) != EOF)
+		switch (c) {
+		case 'a':
+			show_aux++;
+			continue;
+		default:
+			/* error msg already printed */
+			exit(1);
+		}
+
 	get_int_section_table();
 	get_int_symbol_table();
-	dump_symtab();
+	dump_symtab(show_aux);
 	exit(0);
 }
 
@@ -68,7 +81,7 @@
 	putchar('\n');
 	get_int_symbol_table();
 	printf("Symbol table:\n\n");
-	dump_symtab();
+	dump_symtab(0);
 	putchar('\n');
 	exit(0);
 }
--- a/leo-obj/tool/symtab.c	Sun Apr 27 18:07:55 2014 +0000
+++ b/leo-obj/tool/symtab.c	Mon Apr 28 04:51:35 2014 +0000
@@ -59,9 +59,9 @@
 	return(numbuf);
 }
 
-dump_symtab()
+dump_symtab(show_aux)
 {
-	unsigned n;
+	unsigned n, i;
 	struct internal_syment *sym;
 	char *sec, secstr[8];
 	char *class, classbuf[8];
@@ -82,6 +82,11 @@
 		printf("%-5u %-30s %04X %-7s %-12s %08X%s\n",
 			n, sym->name, sym->type, class,
 			sec, sym->value, sym->aux ? " Aux" : "");
+		if (sym->aux && show_aux) {
+			for (i = 0; i < 18; i++)
+				printf("%c%02X", i ? ' ' : '\t', sym->aux[i]);
+			putchar('\n');
+		}
 	}
 	return(0);
 }