From 92a1236ab351b0a12a385ae868b8a5e3ab8a1b90 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 13 Oct 2021 15:23:37 +0100 Subject: [PATCH] Fix linker seg-fault compiling efivar libraries. Resolves: #2012247 --- binutils-empty-MIND-string.patch | 19 +++++++++++++++++++ binutils-testsuite-fixes.patch | 11 +++++++++++ binutils.spec | 9 ++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 binutils-empty-MIND-string.patch diff --git a/binutils-empty-MIND-string.patch b/binutils-empty-MIND-string.patch new file mode 100644 index 0000000..fe648a5 --- /dev/null +++ b/binutils-empty-MIND-string.patch @@ -0,0 +1,19 @@ +--- binutils.orig/bfd/linker.c 2021-10-13 13:21:03.125429867 +0100 ++++ binutils-2.37/bfd/linker.c 2021-10-13 13:33:31.328554905 +0100 +@@ -1420,6 +1420,7 @@ _bfd_generic_link_add_one_symbol (struct + { + row = COMMON_ROW; + if (!bfd_link_relocatable (info) ++ && name != NULL + && name[0] == '_' + && name[1] == '_' + && strcmp (name + (name[2] == '_'), "__gnu_lto_slim") == 0) +@@ -1682,7 +1683,7 @@ _bfd_generic_link_add_one_symbol (struct + cycle = true; + break; + } +- if (strcmp (h->u.i.link->root.string, string) == 0) ++ if (string != NULL && strcmp (h->u.i.link->root.string, string) == 0) + break; + /* Fall through. */ + case MDEF: diff --git a/binutils-testsuite-fixes.patch b/binutils-testsuite-fixes.patch index 3583682..ae82d75 100644 --- a/binutils-testsuite-fixes.patch +++ b/binutils-testsuite-fixes.patch @@ -950,3 +950,14 @@ diff -rup binutils.orig/ld/testsuite/ld-powerpc/tlsso32.r binutils-2.37/ld/tests } if {[is_elf_format]} then { +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2021-10-13 13:21:02.540433685 +0100 ++++ binutils-2.37/ld/testsuite/ld-plugin/lto.exp 2021-10-13 13:37:08.559139599 +0100 +@@ -31,8 +31,6 @@ if { ![check_plugin_api_available] + + set saved_CFLAGS "$CFLAGS" + set saved_CXXFLAGS "$CXXFLAGS" +-regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CFLAGS "" CFLAGS +-regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CXXFLAGS "" CXXFLAGS + + proc restore_notify { } { + global saved_CFLAGS diff --git a/binutils.spec b/binutils.spec index 85dd72c..c096e40 100644 --- a/binutils.spec +++ b/binutils.spec @@ -39,7 +39,7 @@ Summary: A GNU collection of binary utilities Name: binutils%{?name_cross}%{?_with_debug:-debug} Version: 2.37 -Release: 14%{?dist} +Release: 15%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -301,6 +301,10 @@ Patch21: binutils-autoconf-version.patch # Lifetime: Permanent. Patch22: binutils-ld-default-entry-of-0-for-shared.patch +# Purpose: Fix a seg-fault compiling the efivar libraries. +# Lifetime: Fixed in 2.38. +Patch23: binutils-empty-MIND-string.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -910,6 +914,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Wed Oct 13 2021 Nick Clifton - 2.27-15 +- Fix linker seg-fault compiling efivar libraries. (#2012247) + * Wed Sep 29 2021 Nick Clifton - 2.27-14 - Fix linker testsuite failures triggered by 2.27-13 patch. (#2008203)