From 93bf8696623e93acd9b0df7f473ebc7325f0c2fd Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Jul 31 2020 07:13:17 +0000 Subject: Set the sh_entsize field of the AArch64's PLT section to 0. (PR 26312) --- diff --git a/binutils-aarch64-plt-sh_entsize.patch b/binutils-aarch64-plt-sh_entsize.patch new file mode 100644 index 0000000..41912f1 --- /dev/null +++ b/binutils-aarch64-plt-sh_entsize.patch @@ -0,0 +1,27 @@ +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2020-07-30 17:20:30.607580720 +0100 ++++ binutils-2.35/bfd/elfnn-aarch64.c 2020-07-30 17:22:45.629741124 +0100 +@@ -9513,8 +9513,10 @@ elfNN_aarch64_init_small_plt0_entry (bfd + + memcpy (htab->root.splt->contents, htab->plt0_entry, + htab->plt_header_size); +- elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = +- htab->plt_header_size; ++ /* PR 26312: Explicitly set the sh_entsize to 0 so that ++ consumers do not think that the section contains fixed ++ sized objects. */ ++ elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0; + + plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma + + htab->root.sgotplt->output_offset +@@ -9616,10 +9618,6 @@ elfNN_aarch64_finish_dynamic_sections (b + { + elfNN_aarch64_init_small_plt0_entry (output_bfd, htab); + +- elf_section_data (htab->root.splt->output_section)-> +- this_hdr.sh_entsize = htab->plt_entry_size; +- +- + if (htab->root.tlsdesc_plt && !(info->flags & DF_BIND_NOW)) + { + BFD_ASSERT (htab->root.tlsdesc_got != (bfd_vma)-1); diff --git a/binutils.spec b/binutils.spec index 1f9925b..b769d26 100644 --- a/binutils.spec +++ b/binutils.spec @@ -2,7 +2,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.35 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -227,6 +227,11 @@ Patch22: binutils-gcc-10-fixes.patch # Purpose: Default to DWARF level 3 in the assembler. # Lifetime: Fixed in 2.36. Patch23: binutils-gas-dwarf-level-4.patch + +# Purpose: Set the sh_entsize of the AArch64's PLT section to 0. +# Lifetime: Fixed in 2.36. +Patch24: binutils-aarch64-plt-sh_entsize.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -805,6 +810,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Fri Jul 31 2020 Nick Clifton - 2.35-7 +- Set the sh_entsize field of the AArch64's PLT section to 0. (PR 26312) + * Thu Jul 30 2020 Richard W.M. Jones - 2.35-6 - Disable LTO again, it causes "ar" to segfault.