From faa3f7a798f3c242bc927137b553abca8d74cddc Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 02 2018 11:04:42 +0000 Subject: import devtoolset-7-binutils-2.28-8.el7.1 --- diff --git a/SOURCES/binutils-2.27-ppc64-discarded-plt-sections.patch b/SOURCES/binutils-2.27-ppc64-discarded-plt-sections.patch new file mode 100644 index 0000000..dc40f0e --- /dev/null +++ b/SOURCES/binutils-2.27-ppc64-discarded-plt-sections.patch @@ -0,0 +1,79 @@ +diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.27/bfd/elf64-ppc.c +--- binutils.orig/bfd/elf64-ppc.c 2017-11-16 10:35:34.873666405 +0000 ++++ binutils-2.27/bfd/elf64-ppc.c 2017-11-16 10:39:54.037530964 +0000 +@@ -10105,6 +10105,10 @@ ppc64_elf_size_dynamic_sections (bfd *ou + continue; + } + ++ if (bfd_is_abs_section (s->output_section)) ++ _bfd_error_handler (_("warning: discarding dynamic section %s"), ++ s->name); ++ + if ((s->flags & SEC_HAS_CONTENTS) == 0) + continue; + +@@ -10875,7 +10879,7 @@ ppc_build_one_stub (struct bfd_hash_entr + + htab->brlt->output_section->vma); + + off = (dest +- - elf_gp (htab->brlt->output_section->owner) ++ - elf_gp (info->output_bfd) + - htab->sec_info[stub_entry->group->link_sec->id].toc_off); + + if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) +@@ -11025,7 +11029,7 @@ ppc_build_one_stub (struct bfd_hash_entr + } + + off = (dest +- - elf_gp (plt->output_section->owner) ++ - elf_gp (info->output_bfd) + - htab->sec_info[stub_entry->group->link_sec->id].toc_off); + + if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) +@@ -11172,7 +11176,7 @@ ppc_size_one_stub (struct bfd_hash_entry + plt = htab->elf.iplt; + off += (plt->output_offset + + plt->output_section->vma +- - elf_gp (plt->output_section->owner) ++ - elf_gp (info->output_bfd) + - htab->sec_info[stub_entry->group->link_sec->id].toc_off); + + size = plt_stub_size (htab, stub_entry, off); +@@ -11266,7 +11270,7 @@ ppc_size_one_stub (struct bfd_hash_entry + off = (br_entry->offset + + htab->brlt->output_offset + + htab->brlt->output_section->vma +- - elf_gp (htab->brlt->output_section->owner) ++ - elf_gp (info->output_bfd) + - htab->sec_info[stub_entry->group->link_sec->id].toc_off); + + if (info->emitrelocations) +@@ -11386,7 +11390,7 @@ ppc64_elf_next_toc_section (struct bfd_l + output toc base plus 0x8000. Making the input elf_gp an + offset allows us to move the toc as a whole without + recalculating input elf_gp. */ +- off = htab->toc_curr - elf_gp (isec->output_section->owner); ++ off = htab->toc_curr - elf_gp (info->output_bfd); + off += TOC_BASE_OFF; + + /* Die if someone uses a linker script that doesn't keep input +@@ -11415,7 +11419,7 @@ ppc64_elf_next_toc_section (struct bfd_l + } + addr = (htab->toc_first_sec->output_offset + + htab->toc_first_sec->output_section->vma); +- off = addr - elf_gp (isec->output_section->owner) + TOC_BASE_OFF; ++ off = addr - elf_gp (info->output_bfd) + TOC_BASE_OFF; + elf_gp (isec->owner) = off; + + return TRUE; +diff -rup binutils.orig/ld/testsuite/ld-elf/note-3.t binutils-2.27/ld/testsuite/ld-elf/note-3.t +--- binutils.orig/ld/testsuite/ld-elf/note-3.t 2017-11-16 10:35:35.670656893 +0000 ++++ binutils-2.27/ld/testsuite/ld-elf/note-3.t 2017-11-16 10:59:06.352286215 +0000 +@@ -17,6 +17,7 @@ SECTIONS + + .dynstr : { *(.dynstr) } + .dynsym : { *(.dynsym) } ++ .got : { *(.got .toc) *(.igot) } + .got.plt : { *(.got.plt) *(.igot.plt) } + /DISCARD/ : { *(*) } + } diff --git a/SPECS/binutils.spec b/SPECS/binutils.spec index e80b372..d7f5a89 100644 --- a/SPECS/binutils.spec +++ b/SPECS/binutils.spec @@ -49,7 +49,7 @@ Summary: A GNU collection of binary utilities Name: %{?scl_prefix}%{?cross}binutils%{?_with_debug:-debug} Version: 2.28 -Release: 8%{?dist} +Release: 8%{?dist}.1 License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -103,6 +103,12 @@ Patch23: binutils-2.28-ignore-gold-duplicates.patch Patch24: binutils-2.28-ppc-extra-insns.patch # Add support for displaying new DWARF5 tags including DW_AT_export_symbols. Patch25: binutils-2.28-DW_AT_export_symbols.patch +# Purpose: Fix a seg-fault in the PowerPC linker when discarding .plt +# sections when -pie is used and undefined weak symbols are +# present. See PR 22431 and BZs 1515340, 1515347, 1513014 +# Lifetime: Fixed in 2.30. +Patch26: binutils-2.27-ppc64-discarded-plt-sections.patch + Provides: bundled(libiberty) @@ -266,6 +272,7 @@ using libelf instead of BFD. %patch23 -p1 %patch24 -p1 %patch25 -p1 +%patch26 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -625,6 +632,10 @@ exit 0 %endif # %{isnative} %changelog +* Fri Dec 01 2017 Nick Clifton 2.28-8.1 +- Prevent the PowerPC64 linker from triggering a seg-fault when discarding dynamic sections. + (#1519864) + * Thu Aug 31 2017 Nick Clifton 2.28-8 - Remove the Provides line from the spec file. (#1485002)