summaryrefslogtreecommitdiffstats
path: root/opcodes
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-09-22 21:55:17 +0000
committerMike Frysinger <vapier@gentoo.org>2010-09-22 21:55:17 +0000
commit7a360e83fc3bfe89586d408f2107242c85a0daf8 (patch)
treecca0d538cfc389ec61821ef53bd3be59cab18c11 /opcodes
parent35fc57f38cc162286190ec02e5a0064cc9bc71cf (diff)
downloadppe42-binutils-7a360e83fc3bfe89586d408f2107242c85a0daf8.tar.gz
ppe42-binutils-7a360e83fc3bfe89586d408f2107242c85a0daf8.zip
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 <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/bfin-dis.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 07c4d89721..449954ef85 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,7 @@
+2010-09-22 Robin Getz <robin.getz@analog.com>
+
+ * bfin-dis.c (fmtconst): Cast address to 32bits.
+
2010-09-22 Mike Frysinger <vapier@gentoo.org>
* bfin-dis.c (decode_REGMV_0): Rewrite valid combo checks.
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);
OpenPOWER on IntegriCloud