# HG changeset patch # User Michael Spacefalcon # Date 1398660695 0 # Node ID ed533d4698382b680421a418a1fc7f26dde8b4c5 # Parent db16876a2684e4c430df0adc5f477b62f4439069 tiobjd: show symtab aux entries diff -r db16876a2684 -r ed533d469838 leo-obj/tool/basics.c --- 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); } diff -r db16876a2684 -r ed533d469838 leo-obj/tool/symtab.c --- 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); }