From 34ce9a89252ab531e7df3e4f02374c0cee0d1965 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 14 2021 08:39:00 +0000 Subject: import devtoolset-10-binutils-2.35-5.el7.2 --- diff --git a/SOURCES/binutils-secondary-relocs-speed.patch b/SOURCES/binutils-secondary-relocs-speed.patch new file mode 100644 index 0000000..3da4ba7 --- /dev/null +++ b/SOURCES/binutils-secondary-relocs-speed.patch @@ -0,0 +1,62 @@ +diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35/bfd/elf-bfd.h +--- binutils.orig/bfd/elf-bfd.h 2021-06-23 15:00:33.913477324 +0100 ++++ binutils-2.35/bfd/elf-bfd.h 2021-06-23 15:03:42.300235019 +0100 +@@ -1748,6 +1748,11 @@ struct bfd_elf_section_data + /* Link from a text section to its .eh_frame_entry section. */ + asection *eh_frame_entry; + ++ /* TRUE if the section has secondary reloc sections associated with it. ++ FIXME: In the future it might be better to change this into a list ++ of secondary reloc sections, making lookup easier and faster. */ ++ bfd_boolean has_secondary_relocs; ++ + /* A pointer used for various section optimizations. */ + void *sec_info; + }; +diff -rup binutils.orig/bfd/elf.c binutils-2.35/bfd/elf.c +--- binutils.orig/bfd/elf.c 2021-06-23 15:00:33.902477396 +0100 ++++ binutils-2.35/bfd/elf.c 2021-06-23 15:02:36.269672347 +0100 +@@ -12672,6 +12672,7 @@ _bfd_elf_copy_special_section_fields (co + { + asection * isec; + asection * osec; ++ struct bfd_elf_section_data * esd; + + if (isection == NULL) + return FALSE; +@@ -12687,8 +12688,9 @@ _bfd_elf_copy_special_section_fields (co + if (osec == NULL) + return FALSE; + +- BFD_ASSERT (elf_section_data (osec)->sec_info == NULL); +- elf_section_data (osec)->sec_info = elf_section_data (isec)->sec_info; ++ esd = elf_section_data (osec); ++ BFD_ASSERT (esd->sec_info == NULL); ++ esd->sec_info = elf_section_data (isec)->sec_info; + osection->sh_type = SHT_RELA; + osection->sh_link = elf_onesymtab (obfd); + if (osection->sh_link == 0) +@@ -12731,6 +12733,10 @@ _bfd_elf_copy_special_section_fields (co + osection->sh_info = + elf_section_data (isection->bfd_section->output_section)->this_idx; + ++ esd = elf_section_data (isection->bfd_section->output_section); ++ BFD_ASSERT (esd != NULL); ++ osection->sh_info = esd->this_idx; ++ esd->has_secondary_relocs = TRUE; + #if DEBUG_SECONDARY_RELOCS + fprintf (stderr, "update header of %s, sh_link = %u, sh_info = %u\n", + osec->name, osection->sh_link, osection->sh_info); +diff -rup binutils.orig/bfd/elfcode.h binutils-2.35/bfd/elfcode.h +--- binutils.orig/bfd/elfcode.h 2021-06-23 15:00:33.910477344 +0100 ++++ binutils-2.35/bfd/elfcode.h 2021-06-23 15:04:32.506902070 +0100 +@@ -987,7 +987,8 @@ elf_write_relocs (bfd *abfd, asection *s + (*swap_out) (abfd, &src_rela, dst_rela); + } + +- if (!bed->write_secondary_relocs (abfd, sec)) ++ if (elf_section_data (sec)->has_secondary_relocs ++ && !bed->write_secondary_relocs (abfd, sec)) + { + *failedp = TRUE; + return; diff --git a/SPECS/binutils.spec b/SPECS/binutils.spec index 50a1891..9d2c1d7 100644 --- a/SPECS/binutils.spec +++ b/SPECS/binutils.spec @@ -4,7 +4,7 @@ Summary: A GNU collection of binary utilities Name: %{?scl_prefix}%{?cross}binutils%{?_with_debug:-debug} Version: 2.35 -Release: 5%{?dist} +Release: 5%{?dist}.2 License: GPLv3+ URL: https://sourceware.org/binutils @@ -254,6 +254,11 @@ Patch27: binutils-elf-add-objects.patch # Lifetime: Fixed in 2.36 Patch28: binutils-CVE-2021-20197.patch +# Purpose: Remove quadratic performance penalty when processing +# files without secondary relocs. +# Lifetime: Fixed in 2.35.1 +Patch29: binutils-secondary-relocs-speed.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -885,6 +890,12 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Tue Jul 20 2021 Nick Clifton - 2.35-5.2 +- NVR bump to aloow rebuilding with the correct tag. + +* Thu Jul 15 2021 Nick Clifton - 2.35-5.1 +- Remove quadratic performance penalty when processing files without secondary relocs. (#1981885) + * Mon Feb 08 2021 Nick Clifton - 2.35-5 - Extend vulnerability fix again. (#1925779)