Blame SOURCES/binutils-aarch64-plt-sh_entsize.patch

cb7fb9
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c
cb7fb9
--- binutils.orig/bfd/elfnn-aarch64.c	2020-07-30 17:20:30.607580720 +0100
cb7fb9
+++ binutils-2.35/bfd/elfnn-aarch64.c	2020-07-30 17:22:45.629741124 +0100
cb7fb9
@@ -9513,8 +9513,10 @@ elfNN_aarch64_init_small_plt0_entry (bfd
cb7fb9
 
cb7fb9
   memcpy (htab->root.splt->contents, htab->plt0_entry,
cb7fb9
 	  htab->plt_header_size);
cb7fb9
-  elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize =
cb7fb9
-    htab->plt_header_size;
cb7fb9
+  /* PR 26312: Explicitly set the sh_entsize to 0 so that
cb7fb9
+     consumers do not think that the section contains fixed
cb7fb9
+     sized objects.  */
cb7fb9
+  elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
cb7fb9
 
cb7fb9
   plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma
cb7fb9
 		  + htab->root.sgotplt->output_offset
cb7fb9
@@ -9616,10 +9618,6 @@ elfNN_aarch64_finish_dynamic_sections (b
cb7fb9
     {
cb7fb9
       elfNN_aarch64_init_small_plt0_entry (output_bfd, htab);
cb7fb9
 
cb7fb9
-      elf_section_data (htab->root.splt->output_section)->
cb7fb9
-	this_hdr.sh_entsize = htab->plt_entry_size;
cb7fb9
-
cb7fb9
-
cb7fb9
       if (htab->root.tlsdesc_plt && !(info->flags & DF_BIND_NOW))
cb7fb9
 	{
cb7fb9
 	  BFD_ASSERT (htab->root.tlsdesc_got != (bfd_vma)-1);