Refresh patch for binutils bug #23061

This commit is contained in:
Sandro Mani 2018-08-23 10:49:39 +02:00
parent f9d55ce080
commit 6f504232d7
2 changed files with 32 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -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 <manisandro@gmail.com> - 2.30-5
- Refresh patch for binutils bug #23061
* Wed Aug 08 2018 Sandro Mani <manisandro@gmail.com> - 2.30-4
- Backport patch for binutils bug #23061