From 4ef24b049904de74ff11a9adc80f7d519923d8b1 Mon Sep 17 00:00:00 2001 From: nick clifton Date: Apr 12 2011 14:30:38 +0000 Subject: Fix disassembly of i386 objects. (BZ 695565) --- diff --git a/binutils-2.20.51.0.7-i386-dis.patch b/binutils-2.20.51.0.7-i386-dis.patch new file mode 100644 index 0000000..ead663b --- /dev/null +++ b/binutils-2.20.51.0.7-i386-dis.patch @@ -0,0 +1,87 @@ +*** ../binutils-2.20.51.0.7.orig/opcodes/i386-dis.c 2011-04-12 14:42:20.870382006 +0100 +--- opcodes/i386-dis.c 2011-04-12 14:45:34.074381878 +0100 +*************** get_valid_dis386 (const struct dis386 *d +*** 11059,11065 **** + switch ((*codep & 0x1f)) + { + default: +! BadOp (); + case 0x8: + vex_table_index = XOP_08; + break; +--- 11059,11065 ---- + switch ((*codep & 0x1f)) + { + default: +! return & bad_opcode; + case 0x8: + vex_table_index = XOP_08; + break; +*************** get_valid_dis386 (const struct dis386 *d +*** 11078,11084 **** + vex.register_specifier = (~(*codep >> 3)) & 0xf; + if (address_mode != mode_64bit + && vex.register_specifier > 0x7) +! BadOp (); + + vex.length = (*codep & 0x4) ? 256 : 128; + switch ((*codep & 0x3)) +--- 11078,11084 ---- + vex.register_specifier = (~(*codep >> 3)) & 0xf; + if (address_mode != mode_64bit + && vex.register_specifier > 0x7) +! return & bad_opcode; + + vex.length = (*codep & 0x4) ? 256 : 128; + switch ((*codep & 0x3)) +*************** get_valid_dis386 (const struct dis386 *d +*** 11116,11122 **** + switch ((*codep & 0x1f)) + { + default: +! BadOp (); + case 0x1: + vex_table_index = VEX_0F; + break; +--- 11116,11122 ---- + switch ((*codep & 0x1f)) + { + default: +! return & bad_opcode; + case 0x1: + vex_table_index = VEX_0F; + break; +*************** get_valid_dis386 (const struct dis386 *d +*** 11135,11141 **** + vex.register_specifier = (~(*codep >> 3)) & 0xf; + if (address_mode != mode_64bit + && vex.register_specifier > 0x7) +! BadOp (); + + vex.length = (*codep & 0x4) ? 256 : 128; + switch ((*codep & 0x3)) +--- 11135,11141 ---- + vex.register_specifier = (~(*codep >> 3)) & 0xf; + if (address_mode != mode_64bit + && vex.register_specifier > 0x7) +! return & bad_opcode; + + vex.length = (*codep & 0x4) ? 256 : 128; + switch ((*codep & 0x3)) +*************** get_valid_dis386 (const struct dis386 *d +*** 11177,11183 **** + vex.register_specifier = (~(*codep >> 3)) & 0xf; + if (address_mode != mode_64bit + && vex.register_specifier > 0x7) +! BadOp (); + + vex.w = 0; + +--- 11177,11183 ---- + vex.register_specifier = (~(*codep >> 3)) & 0xf; + if (address_mode != mode_64bit + && vex.register_specifier > 0x7) +! return & bad_opcode; + + vex.w = 0; + diff --git a/binutils.spec b/binutils.spec index 92a41c0..235896b 100644 --- a/binutils.spec +++ b/binutils.spec @@ -17,7 +17,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.20.51.0.7 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -35,6 +35,7 @@ Patch09: binutils-2.20.51.0.7-do-not-bind-unique-symbols-locally.patch Patch10: binutils-2.20.51.0.7-dwarf4.patch Patch11: binutils-2.20.51.0.7-unique-archive-symbols.patch Patch12: binutils-2.20.51.0.7-gold-INPUT.patch +Patch13: binutils-2.20.51.0.7-i386-dis.patch %define gold_arches %ix86 x86_64 @@ -137,6 +138,7 @@ using libelf instead of BFD. %patch10 -p0 -b .dwarf4~ %patch11 -p0 -b .unique~ %patch12 -p0 -b .gold-input~ +%patch13 -p0 -b .i386-dis~ # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -419,6 +421,9 @@ exit 0 %endif # %{isnative} %changelog +* Tue Apr 12 2011 Nick Clifton - 2.20.51.0.7-6 +- Fix disassembly of i386 objects. (BZ 695565) + * Wed Jun 30 2010 Nick Clifton - 2.20.51.0.7-5 - Rename the binutils-static package to binutils-devel in line with the Fedora packaging guidelines.