From 9d4201645fbaa67738d6efda81a068251cb22064 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 22 Sep 2010 21:55:17 +0000 Subject: opcodes: blackfin: fix decoding of 32bit addresses on 64bit systems The Blackfin ISA is very exact with regards to address truncation when under/over flowing its 32bit range. On a 32bit system, things work the same and so addresses are decoded properly. On a 64bit system though, the decoded addresses may include the bits that are supposed to have been truncated. So force a 32bit truncation after the address has been calculated. Signed-off-by: Robin Getz Signed-off-by: Mike Frysinger --- opcodes/bfin-dis.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'opcodes/bfin-dis.c') diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c index b17e0552b9..0aec087c83 100644 --- a/opcodes/bfin-dis.c +++ b/opcodes/bfin-dis.c @@ -138,6 +138,9 @@ fmtconst (const_forms_t cf, TIword x, bfd_vma pc, disassemble_info *outf) if (constant_formats[cf].pcrel) ea += pc; + /* truncate to 32-bits for proper symbol lookup/matching */ + ea = (bu32)ea; + if (outf->symbol_at_address_func (ea, outf) || !constant_formats[cf].exact) { outf->print_address_func (ea, outf); -- cgit v1.2.1