summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--0001-PR25447.patch35
-rw-r--r--0002-PR24511.patch32
-rw-r--r--cygwin-libbfd.spec8
-rw-r--r--sources2
5 files changed, 75 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 52bd323..6593422 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1 @@
-/binutils-2.25.1.tar.bz2
-/binutils-2.29.1.tar.xz
-/binutils-2.31.1.tar.xz
+/binutils-*.tar.xz
diff --git a/0001-PR25447.patch b/0001-PR25447.patch
new file mode 100644
index 0000000..9f24939
--- /dev/null
+++ b/0001-PR25447.patch
@@ -0,0 +1,35 @@
+From 82f439d028c65663a0baf0a17ef5c4a2ea5c84a7 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Tue, 11 Feb 2020 15:55:25 +0000
+Subject: [PATCH] Import a fix from the mainline sources that prevents a
+ potential illegal memory access when parsing PE binaries.
+
+ PR 25447
+ * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
+ syms and keep strings flags as these may have been set in order to
+ prevent a bogus call to free.
+---
+ bfd/ChangeLog | 9 +++++++++
+ bfd/coffgen.c | 6 ++++--
+ 2 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/bfd/coffgen.c b/bfd/coffgen.c
+index 2bfcf1a6b14..3ddd2d89a83 100644
+--- a/bfd/coffgen.c
++++ b/bfd/coffgen.c
+@@ -3175,8 +3175,10 @@ _bfd_coff_close_and_cleanup (bfd *abfd)
+ && bfd_family_coff (abfd)
+ && coff_data (abfd) != NULL)
+ {
+- obj_coff_keep_syms (abfd) = FALSE;
+- obj_coff_keep_strings (abfd) = FALSE;
++ /* PR 25447:
++ Do not clear the keep_syms and keep_strings flags.
++ These may have been set by pe_ILF_build_a_bfd() indicating
++ that the syms and strings pointers are not to be freed. */
+ if (!_bfd_coff_free_symbols (abfd))
+ return FALSE;
+ }
+--
+2.18.2
+
diff --git a/0002-PR24511.patch b/0002-PR24511.patch
new file mode 100644
index 0000000..a763d41
--- /dev/null
+++ b/0002-PR24511.patch
@@ -0,0 +1,32 @@
+From 40bfb9762747f8336b17c70a0173d10200fa62eb Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Thu, 27 Feb 2020 17:28:47 +1030
+Subject: [PATCH] Re: PR24511, nm should not mark symbols in .init_array as "t"
+
+ PR 24511
+ * syms.c (bfd_decode_symclass): Reverse order of coff_section_type
+ and decode_section_type calls.
+---
+ bfd/ChangeLog | 6 ++++++
+ bfd/syms.c | 4 ++--
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/bfd/syms.c b/bfd/syms.c
+index 128cf191453..8a8b74f3f92 100644
+--- a/bfd/syms.c
++++ b/bfd/syms.c
+@@ -705,9 +705,9 @@ bfd_decode_symclass (asymbol *symbol)
+ c = 'a';
+ else if (symbol->section)
+ {
+- c = decode_section_type (symbol->section);
++ c = coff_section_type (symbol->section->name);
+ if (c == '?')
+- c = coff_section_type (symbol->section->name);
++ c = decode_section_type (symbol->section);
+ }
+ else
+ return '?';
+--
+2.18.2
+
diff --git a/cygwin-libbfd.spec b/cygwin-libbfd.spec
index 4a05898..6017add 100644
--- a/cygwin-libbfd.spec
+++ b/cygwin-libbfd.spec
@@ -1,7 +1,7 @@
%{?cygwin_package_header}
Name: cygwin-libbfd
-Version: 2.31.1
+Version: 2.34
Release: 1%{?dist}
Summary: Cygwin BFD and opcodes libraries
@@ -11,6 +11,8 @@ URL: http://www.gnu.org/software/binutils/
BuildArch: noarch
Source0: http://ftpmirror.gnu.org/binutils/binutils-%{version}.tar.xz
+Patch1: 0001-PR25447.patch
+Patch2: 0002-PR24511.patch
BuildRequires: gcc
BuildRequires: flex
@@ -61,7 +63,7 @@ unstable to be used dynamically.
%prep
-%setup -q -n binutils-%{version}
+%autosetup -n binutils-%{version} -p1
%build
@@ -91,6 +93,7 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%{cygwin32_includedir}/ansidecl.h
%{cygwin32_includedir}/bfd.h
%{cygwin32_includedir}/bfdlink.h
+%{cygwin32_includedir}/bfd_stdint.h
%{cygwin32_includedir}/diagnostics.h
%{cygwin32_includedir}/dis-asm.h
%{cygwin32_includedir}/plugin-api.h
@@ -104,6 +107,7 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%{cygwin64_includedir}/ansidecl.h
%{cygwin64_includedir}/bfd.h
%{cygwin64_includedir}/bfdlink.h
+%{cygwin64_includedir}/bfd_stdint.h
%{cygwin64_includedir}/diagnostics.h
%{cygwin64_includedir}/dis-asm.h
%{cygwin64_includedir}/plugin-api.h
diff --git a/sources b/sources
index fe5ad02..ef80505 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-5b7c9d4ce96f507d95c1b9a255e52418 binutils-2.31.1.tar.xz
+SHA512 (binutils-2.34.tar.xz) = 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd