From 6f504232d717a9c0258bf04062faf60d10131d9b Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Thu, 23 Aug 2018 10:49:39 +0200 Subject: [PATCH] Refresh patch for binutils bug #23061 --- binutils_bug_23061.patch | 35 ++++++++++++++++++++++++++++------- mingw-binutils.spec | 5 ++++- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/binutils_bug_23061.patch b/binutils_bug_23061.patch index c6e6c43..d327d9b 100644 --- a/binutils_bug_23061.patch +++ b/binutils_bug_23061.patch @@ -1,25 +1,46 @@ 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, ++++ binutils-2.30-new/bfd/coffgen.c 2018-08-22 10:26:43.019855632 +0200 +@@ -1521,7 +1521,8 @@ coff_pointerize_aux (bfd *abfd, + combined_entry_type *table_base, + combined_entry_type *symbol, + unsigned int indaux, +- combined_entry_type *auxent) ++ combined_entry_type *auxent, ++ combined_entry_type *table_end) + { + unsigned int type = symbol->u.syment.n_type; + unsigned int n_sclass = symbol->u.syment.n_sclass; +@@ -1547,7 +1548,11 @@ 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)) ++ < (long) obj_raw_syment_count (abfd) ++ && table_base + auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l ++ < table_end) { 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, +@@ -1555,7 +1560,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)) ++ if ((unsigned long) auxent->u.auxent.x_sym.x_tagndx.l ++ < obj_raw_syment_count (abfd) ++ && table_base + auxent->u.auxent.x_sym.x_tagndx.l < table_end) { auxent->u.auxent.x_sym.x_tagndx.p = table_base + auxent->u.auxent.x_sym.x_tagndx.l; +@@ -1864,7 +1871,7 @@ coff_get_normalized_symtab (bfd *abfd) + + internal_ptr->is_sym = FALSE; + coff_pointerize_aux (abfd, internal, symbol_ptr, i, +- internal_ptr); ++ internal_ptr, internal_end); + } + } + diff --git a/mingw-binutils.spec b/mingw-binutils.spec index 9f5b1eb..33cda69 100644 --- a/mingw-binutils.spec +++ b/mingw-binutils.spec @@ -2,7 +2,7 @@ Name: mingw-binutils Version: 2.30 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Cross-compiled version of binutils for Win32 and Win64 environments License: GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+ @@ -260,6 +260,9 @@ rm -rf $RPM_BUILD_ROOT/multilib %changelog +* Wed Aug 22 2018 Sandro Mani - 2.30-5 +- Refresh patch for binutils bug #23061 + * Wed Aug 08 2018 Sandro Mani - 2.30-4 - Backport patch for binutils bug #23061