diff --git a/tools/disaout/opset.c b/tools/disaout/opset.c index e0d46de..9745d76 100644 --- a/tools/disaout/opset.c +++ b/tools/disaout/opset.c @@ -166,6 +166,8 @@ int guess_jsr_r5(int addr) add_symbol(addr, SYM_JSRDATA, 2); return(2); } else { + /* Ensure length is word-aligned */ + if ((addr+len)%2) len++; add_symbol(addr, SYM_JSRTEXT, len); return(len); } @@ -182,6 +184,7 @@ void printquoted(char *str) } str++; } + printf("\\0"); } /* diff --git a/tools/disaout/symbols.c b/tools/disaout/symbols.c index 6f76e31..8b6f990 100644 --- a/tools/disaout/symbols.c +++ b/tools/disaout/symbols.c @@ -34,7 +34,9 @@ void add_symbol(int addr, int type, int size) struct symbol *s; /* See if we have a symbol already defined at this address */ - if (symtypelist[type].table[addr] != NULL) return; + /* If there is one and its type is >= ours, don't put a new one in */ + if ((symtypelist[type].table[addr] != NULL) && + (symtypelist[type].table[addr]->type >= type)) return; /* No, so create one */ s= malloc(sizeof(struct symbol));