Set the sh_entsize field of the AArch64's PLT section to 0. (PR 26312)

This commit is contained in:
Nick Clifton 2020-07-31 08:13:17 +01:00
parent 6442193bff
commit 93bf869662
2 changed files with 36 additions and 1 deletions

View File

@ -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);

View File

@ -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 <nickc@redhat.com> - 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 <rjones@redhat.com> - 2.35-6
- Disable LTO again, it causes "ar" to segfault.