Do not discard debugobj files created by GCC v8 LTO wrapper.

Resolves: #1543912
This commit is contained in:
Nick Clifton 2018-03-14 10:42:46 +00:00
parent 92298b1c04
commit c05cfd7b3e
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,39 @@
--- binutils.orig/bfd/elflink.c 2018-03-14 10:14:49.729271271 +0000
+++ binutils-2.30/bfd/elflink.c 2018-03-14 10:15:15.748967793 +0000
@@ -12785,7 +12785,7 @@ _bfd_elf_gc_mark_hook (asection *sec,
return NULL;
}
-/* Return the global debug definition section. */
+/* Return the debug definition section. */
static asection *
elf_gc_mark_debug_section (asection *sec ATTRIBUTE_UNUSED,
@@ -12794,11 +12794,22 @@ elf_gc_mark_debug_section (asection *sec
struct elf_link_hash_entry *h,
Elf_Internal_Sym *sym ATTRIBUTE_UNUSED)
{
- if (h != NULL
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && (h->root.u.def.section->flags & SEC_DEBUGGING) != 0)
- return h->root.u.def.section;
+ if (h != NULL)
+ {
+ /* Return the global debug definition section. */
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && (h->root.u.def.section->flags & SEC_DEBUGGING) != 0)
+ return h->root.u.def.section;
+ }
+ else
+ {
+ /* Return the local debug definition section. */
+ asection *isec = bfd_section_from_elf_index (sec->owner,
+ sym->st_shndx);
+ if ((isec->flags & SEC_DEBUGGING) != 0)
+ return isec;
+ }
return NULL;
}

View File

@ -62,7 +62,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.30
Release: 12%{?dist}
Release: 13%{?dist}
License: GPLv3+
Group: Development/Tools
URL: https://sourceware.org/binutils
@ -184,6 +184,11 @@ Patch16: binutils-2.28-ignore-gold-duplicates.patch
# Lifetime: Fixed in 2.31.
Patch17: binutils-ifunc-relocs-in-notes.patch
# Purpose: Do not discard debug only object files created by GCC v8's
# LTO wrapper.
# Lifetime: Fixed in 2.31.
Patch18: binutils-debug-section-marking.patch
#----------------------------------------------------------------------------
Provides: bundled(libiberty)
@ -326,6 +331,7 @@ using libelf instead of BFD.
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -734,6 +740,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Wed Mar 14 2018 Nick Clifton <nickc@redhat.com> 2.30-13
- Do not discard debugobj files created by GCC v8 LTO wrapper. (#1543912 and RHBZ 84847 and PR 20882)
* Fri Mar 09 2018 Nick Clifton <nickc@redhat.com> 2.30-12
- Treat relocs against s390x IFUNC symbols in note sections as relocs against the FUNC symbol instead.
- Combined previous patches into one which covers all ifunc supporting architectures.