From 40ca8bea3cafb4e78d80e04cc0fa14d150999991 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 8 Mar 2017 16:05:20 +0000 Subject: [PATCH] Update GNU BUILD NOTES patch. Import FSF binutils patch to fix an abort with PowerPC dynamic relocs. --- binutils-2.28-ppc-dynamic-relocs.patch | 15 +++++++++++++++ binutils-gnu-build-notes.patch | 22 ++++++++++++++++++++++ binutils.spec | 9 ++++++++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 binutils-2.28-ppc-dynamic-relocs.patch diff --git a/binutils-2.28-ppc-dynamic-relocs.patch b/binutils-2.28-ppc-dynamic-relocs.patch new file mode 100644 index 0000000..2017dae --- /dev/null +++ b/binutils-2.28-ppc-dynamic-relocs.patch @@ -0,0 +1,15 @@ +--- binutils.orig/bfd/elf64-ppc.c 2017-03-08 15:44:25.132804697 +0000 ++++ binutils-2.28/bfd/elf64-ppc.c 2017-03-08 15:44:54.596440794 +0000 +@@ -14798,8 +14798,10 @@ ppc64_elf_relocate_section (bfd *output_ + break; + + if (bfd_link_pic (info) +- ? ((h != NULL && pc_dynrelocs (h)) +- || must_be_dyn_reloc (info, r_type)) ++ ? ((h == NULL ++ || h->dyn_relocs != NULL) ++ && ((h != NULL && pc_dynrelocs (h)) ++ || must_be_dyn_reloc (info, r_type))) + : (h != NULL + ? h->dyn_relocs != NULL + : ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)) diff --git a/binutils-gnu-build-notes.patch b/binutils-gnu-build-notes.patch index cab4c3e..4772f0a 100644 --- a/binutils-gnu-build-notes.patch +++ b/binutils-gnu-build-notes.patch @@ -1326,3 +1326,25 @@ diff -rup binutils.orig/include/elf/common.h binutils-2.28/include/elf/common.h + .popsection + + +--- binutils.orig/binutils/readelf.c 2017-03-06 16:55:38.741902216 +0000 ++++ binutils-2.28/binutils/readelf.c 2017-03-06 16:55:50.435746360 +0000 +@@ -16529,7 +16529,9 @@ print_gnu_build_attribute_name (Elf_Inte + + while (bytes --) + { +- val |= ((* name ++) << shift); ++ unsigned long byte = (* name ++) & 0xff; ++ ++ val |= byte << shift; + shift += 8; + } + +@@ -16798,7 +16800,7 @@ process_notes_at (FILE * fi + break; + } + +- strncpy (temp, inote.namedata, inote.namesz); ++ memcpy (temp, inote.namedata, inote.namesz); + temp[inote.namesz] = 0; + + /* warn (_("'%s' NOTE name not properly null terminated\n"), temp); */ diff --git a/binutils.spec b/binutils.spec index f616246..229cf05 100644 --- a/binutils.spec +++ b/binutils.spec @@ -43,7 +43,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.28 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -85,6 +85,8 @@ Patch16: binutils-2.28-libiberty-bugfixes.patch Patch17: binutils-gnu-build-notes.patch # GAS: Emit name, comp_dir and producer strings in .debug_str. Patch18: binutils-2.28-gas-comp_dir.patch +# Import fix for PR 21124 and 20519 +Patch19: binutils-2.28-ppc-dynamic-relocs.patch Provides: bundled(libiberty) @@ -224,6 +226,7 @@ using libelf instead of BFD. %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -590,6 +593,10 @@ exit 0 %endif # %{isnative} %changelog +* Wed Mar 08 2017 Nick Clifton 2.28-4 +- Update GNU BUILD NOTES patch. +- Import FSF binutils patch to fix an abort with PowerPC dynamic relocs. + * Mon Mar 06 2017 Mark Wielaard 2.28-3 - Backport patch to add support for putting name, comp_dir and producer strings into the .debug_str section.