Fix linker seg-fault compiling efivar libraries.

Resolves: #2012247
This commit is contained in:
Nick Clifton 2021-10-13 15:23:37 +01:00
parent 752fe419ea
commit 92a1236ab3
3 changed files with 38 additions and 1 deletions

View File

@ -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:

View File

@ -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

View File

@ -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 <nickc@redhat.com> - 2.27-15
- Fix linker seg-fault compiling efivar libraries. (#2012247)
* Wed Sep 29 2021 Nick Clifton <nickc@redhat.com> - 2.27-14
- Fix linker testsuite failures triggered by 2.27-13 patch. (#2008203)