From 475017c95157c575119c9952dd7dca589c94be59 Mon Sep 17 00:00:00 2001 From: "warren.toomey" Date: Fri, 23 May 2008 00:21:50 +0000 Subject: [PATCH] Ensure that we keep to evenly-aligned instructions: helps with jsr r5. Ensure that function symbols overrride branch symbols. --- tools/disaout/opset.c | 3 +++ tools/disaout/symbols.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) 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));