From 90851841a52146be5dcb88ef2bfcc2c9a87c2282 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Feb 19 2016 10:38:59 +0000 Subject: Fix an internal error linking object files with IFUNC relocations in debug sections. Resolves: #1309763 --- diff --git a/binutils-rh1309763.patch b/binutils-rh1309763.patch new file mode 100644 index 0000000..47bfa56 --- /dev/null +++ b/binutils-rh1309763.patch @@ -0,0 +1,42 @@ +--- binutils-2.25.orig/bfd/elf64-x86-64.c 2016-02-19 10:22:44.932019197 +0000 ++++ binutils-2.25/bfd/elf64-x86-64.c 2016-02-19 10:24:07.288484359 +0000 +@@ -3569,8 +3569,16 @@ elf_x86_64_relocate_section (bfd *output + bfd_vma plt_index; + const char *name; + +- if ((input_section->flags & SEC_ALLOC) == 0 +- || h->plt.offset == (bfd_vma) -1) ++ if ((input_section->flags & SEC_ALLOC) == 0) ++ { ++ /* Dynamic relocs are not propagated for SEC_DEBUGGING ++ sections because such sections are not SEC_ALLOC and ++ thus ld.so will not process them. */ ++ if ((input_section->flags & SEC_DEBUGGING) != 0) ++ continue; ++ abort (); ++ } ++ else if (h->plt.offset == (bfd_vma) -1) + abort (); + + /* STT_GNU_IFUNC symbol must go through PLT. */ +--- binutils-2.25.orig/bfd/elf32-i386.c 2016-02-19 10:22:44.899019010 +0000 ++++ binutils-2.25/bfd/elf32-i386.c 2016-02-19 10:26:56.373436838 +0000 +@@ -3336,8 +3336,16 @@ elf_i386_relocate_section (bfd *output_b + bfd_vma plt_index; + const char *name; + +- if ((input_section->flags & SEC_ALLOC) == 0 +- || h->plt.offset == (bfd_vma) -1) ++ if ((input_section->flags & SEC_ALLOC) == 0) ++ { ++ /* Dynamic relocs are not propagated for SEC_DEBUGGING ++ sections because such sections are not SEC_ALLOC and ++ thus ld.so will not process them. */ ++ if ((input_section->flags & SEC_DEBUGGING) != 0) ++ continue; ++ abort (); ++ } ++ else if (h->plt.offset == (bfd_vma) -1) + abort (); + + /* STT_GNU_IFUNC symbol must go through PLT. */ diff --git a/binutils.spec b/binutils.spec index 1fc66c7..19dfe0f 100644 --- a/binutils.spec +++ b/binutils.spec @@ -19,7 +19,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.25 -Release: 15%{?dist} +Release: 16%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -61,7 +61,8 @@ Patch16: binutils-2.25-aarch64-fPIC-error.patch Patch17: binutils-2.25.1-dynamic_list.patch # Fix creating GOT entries for AArch64 binaries. Patch18: binutils-2.25-aarch64-pr18668.patch - +# Fix internal linker error processing IFUNC relocations in debug sections. +Patch19: binutils-rh1309763.patch Provides: bundled(libiberty) @@ -188,6 +189,7 @@ using libelf instead of BFD. %patch16 -p1 -b .aarch64-fpic~ %patch17 -p1 -b .dynamic_list~ %patch18 -p1 +%patch19 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -501,6 +503,10 @@ exit 0 %endif # %{isnative} %changelog +* Fri Feb 19 2016 Nick Clifton 2.25-16 +- Fix an internal error linking object files with IFUNC relocations in debug sections. + (#1309763) + * Wed Sep 30 2015 Nick Clifton 2.25-15 - Ensure that the patch applies for native AArch64 builds. (#1262091)