This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Skip if size of bfd_vma is smaller than address size
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 23 Apr 2016 16:34:56 -0000
- Subject: [binutils-gdb] Skip if size of bfd_vma is smaller than address size
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c0f92bf9430546707f2154b8a2656974e5c7093c
commit c0f92bf9430546707f2154b8a2656974e5c7093c
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Apr 23 09:32:59 2016 -0700
Skip if size of bfd_vma is smaller than address size
Disassembler won't work properly when size of bfd_vma is smaller than
address size.
PR binutils/19983
PR binutils/19984
* i386-dis.c (print_insn): Return -1 if size of bfd_vma is
smaller than address size.
Diff:
---
opcodes/ChangeLog | 7 +++++++
opcodes/i386-dis.c | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index c423976..b835086 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2016-04-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/19983
+ PR binutils/19984
+ * i386-dis.c (print_insn): Return -1 if size of bfd_vma is
+ smaller than address size.
+
2016-04-20 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* alpha-dis.c: Regenerate.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index de0534c..560f75c 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -13327,6 +13327,13 @@ print_insn (bfd_vma pc, disassemble_info *info)
p++;
}
+ if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
+ {
+ (*info->fprintf_func) (info->stream,
+ _("64-bit address is disabled"));
+ return -1;
+ }
+
if (intel_syntax)
{
names64 = intel_names64;