Fix building with LTO enabled.
This commit is contained in:
parent
93bf869662
commit
b22933e83e
1981
binutils-add-sym-cache-to-elf-link-hash.patch
Normal file
1981
binutils-add-sym-cache-to-elf-link-hash.patch
Normal file
File diff suppressed because it is too large
Load Diff
36
binutils-elf-add-objects.patch
Normal file
36
binutils-elf-add-objects.patch
Normal file
@ -0,0 +1,36 @@
|
||||
--- binutils.orig/bfd/elflink.c 2020-07-31 10:45:48.747912761 +0100
|
||||
+++ binutils-2.35/bfd/elflink.c 2020-07-31 10:47:26.336262770 +0100
|
||||
@@ -505,6 +505,16 @@ bfd_elf_link_record_dynamic_symbol (stru
|
||||
const char *name;
|
||||
size_t indx;
|
||||
|
||||
+ if (h->root.type == bfd_link_hash_defined
|
||||
+ || h->root.type == bfd_link_hash_defweak)
|
||||
+ {
|
||||
+ /* An IR symbol should not be made dynamic. */
|
||||
+ if (h->root.u.def.section != NULL
|
||||
+ && h->root.u.def.section->owner != NULL
|
||||
+ && (h->root.u.def.section->owner->flags & BFD_PLUGIN) != 0)
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
/* XXX: The ABI draft says the linker must turn hidden and
|
||||
internal symbols into STB_LOCAL symbols when producing the
|
||||
DSO. However, if ld.so honors st_other in the dynamic table,
|
||||
@@ -5199,15 +5209,11 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
break;
|
||||
}
|
||||
|
||||
- /* Don't add DT_NEEDED for references from the dummy bfd nor
|
||||
- for unmatched symbol. */
|
||||
if (!add_needed
|
||||
&& matched
|
||||
&& definition
|
||||
&& ((dynsym
|
||||
- && h->ref_regular_nonweak
|
||||
- && (old_bfd == NULL
|
||||
- || (old_bfd->flags & BFD_PLUGIN) == 0))
|
||||
+ && h->ref_regular_nonweak)
|
||||
|| (h->ref_dynamic_nonweak
|
||||
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
|
||||
&& !on_needed_list (elf_dt_name (abfd),
|
@ -2,7 +2,7 @@
|
||||
Summary: A GNU collection of binary utilities
|
||||
Name: %{?cross}binutils%{?_with_debug:-debug}
|
||||
Version: 2.35
|
||||
Release: 7%{?dist}
|
||||
Release: 8%{?dist}
|
||||
License: GPLv3+
|
||||
URL: https://sourceware.org/binutils
|
||||
|
||||
@ -232,6 +232,11 @@ Patch23: binutils-gas-dwarf-level-4.patch
|
||||
# Lifetime: Fixed in 2.36.
|
||||
Patch24: binutils-aarch64-plt-sh_entsize.patch
|
||||
|
||||
# Purpose: Fixes for linking LTO objects.
|
||||
# Lifetime: Fixed in 2.36
|
||||
Patch25: binutils-add-sym-cache-to-elf-link-hash.patch
|
||||
Patch26: binutils-elf-add-objects.patch
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
Provides: bundled(libiberty)
|
||||
@ -416,7 +421,7 @@ touch */configure
|
||||
# LTO is triggering a bug in ld which in turn causes ld to create incorrect
|
||||
# binaries. It is not yet clear how serious this bug is (still debugging).
|
||||
# Until that analysis is finished I am disabling LTO
|
||||
%define _lto_cflags %{nil}
|
||||
#define _lto_cflags %%{nil}
|
||||
|
||||
echo target is %{binutils_target}
|
||||
|
||||
@ -810,6 +815,9 @@ exit 0
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
%changelog
|
||||
* Fri Jul 31 2020 Nick Clifton <nickc@redhat.com> - 2.35-8
|
||||
- Fix building with LTO enabled.
|
||||
|
||||
* Fri Jul 31 2020 Nick Clifton <nickc@redhat.com> - 2.35-7
|
||||
- Set the sh_entsize field of the AArch64's PLT section to 0. (PR 26312)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user