From f9d55ce080a6e8c2248d50b8405f339e42e4add9 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Thu, 9 Aug 2018 00:45:27 +0200 Subject: [PATCH] Backport patch for binutils bug #23061 --- binutils_bug_23061.patch | 25 +++++++++++++++++++++++++ mingw-binutils.spec | 9 ++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 binutils_bug_23061.patch diff --git a/binutils_bug_23061.patch b/binutils_bug_23061.patch new file mode 100644 index 0000000..c6e6c43 --- /dev/null +++ b/binutils_bug_23061.patch @@ -0,0 +1,25 @@ +diff -rupN binutils-2.30/bfd/coffgen.c binutils-2.30-new/bfd/coffgen.c +--- binutils-2.30/bfd/coffgen.c 2018-01-13 14:31:15.000000000 +0100 ++++ binutils-2.30-new/bfd/coffgen.c 2018-08-09 00:21:08.766188957 +0200 +@@ -1547,7 +1547,9 @@ coff_pointerize_aux (bfd *abfd, + + if ((ISFCN (type) || ISTAG (n_sclass) || n_sclass == C_BLOCK + || n_sclass == C_FCN) +- && auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l > 0) ++ && auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l > 0 ++ && auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l ++ < (long) obj_raw_syment_count (abfd)) + { + auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p = + table_base + auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l; +@@ -1555,7 +1557,9 @@ coff_pointerize_aux (bfd *abfd, + } + /* A negative tagndx is meaningless, but the SCO 3.2v4 cc can + generate one, so we must be careful to ignore it. */ +- if (auxent->u.auxent.x_sym.x_tagndx.l > 0) ++ if (auxent->u.auxent.x_sym.x_tagndx.l > 0 ++ && auxent->u.auxent.x_sym.x_tagndx.l ++ < (long) obj_raw_syment_count (abfd)) + { + auxent->u.auxent.x_sym.x_tagndx.p = + table_base + auxent->u.auxent.x_sym.x_tagndx.l; diff --git a/mingw-binutils.spec b/mingw-binutils.spec index daaf7db..9f5b1eb 100644 --- a/mingw-binutils.spec +++ b/mingw-binutils.spec @@ -2,7 +2,7 @@ Name: mingw-binutils Version: 2.30 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Cross-compiled version of binutils for Win32 and Win64 environments License: GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+ @@ -16,6 +16,10 @@ Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2 # See https://sourceware.org/bugzilla/show_bug.cgi?id=22762 Patch0: 0200-remove-provide-qualifiers.patch +# Backport https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e9af4700bc7435e593dd74d4d2e099b3d7c01eb6 +# See https://sourceware.org/bugzilla/show_bug.cgi?id=23061 +Patch1: binutils_bug_23061.patch + BuildRequires: gcc BuildRequires: flex BuildRequires: bison @@ -256,6 +260,9 @@ rm -rf $RPM_BUILD_ROOT/multilib %changelog +* Wed Aug 08 2018 Sandro Mani - 2.30-4 +- Backport patch for binutils bug #23061 + * Fri Jul 13 2018 Fedora Release Engineering - 2.30-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild