Blame SOURCES/binutils-CVE-2021-20284.patch

61bcc6
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
61bcc6
--- binutils.orig/bfd/elf-bfd.h	2021-05-19 15:05:30.988901261 +0100
61bcc6
+++ binutils-2.30/bfd/elf-bfd.h	2021-05-19 15:05:55.477815716 +0100
61bcc6
@@ -1487,7 +1487,7 @@ struct elf_backend_data
61bcc6
   bfd_boolean (*init_secondary_reloc_section) (bfd *, Elf_Internal_Shdr *, const char *, unsigned int);
61bcc6
 
61bcc6
   /* Called when after loading the normal relocs for a section.  */
61bcc6
-  bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **);
61bcc6
+  bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
61bcc6
 
61bcc6
   /* Called after writing the normal relocs for a section.  */
61bcc6
   bfd_boolean (*write_secondary_relocs) (bfd *, asection *);
61bcc6
@@ -2721,7 +2721,7 @@ extern bfd_vma elf32_r_sym (bfd_vma);
61bcc6
 extern bfd_boolean _bfd_elf_init_secondary_reloc_section
61bcc6
   (bfd *, Elf_Internal_Shdr *, const char *, unsigned int);
61bcc6
 extern bfd_boolean _bfd_elf_slurp_secondary_reloc_section
61bcc6
-  (bfd *, asection *, asymbol **);
61bcc6
+(bfd *, asection *, asymbol **, bfd_boolean);
61bcc6
 extern bfd_boolean _bfd_elf_copy_special_section_fields
61bcc6
   (const bfd *, bfd *, const Elf_Internal_Shdr *, Elf_Internal_Shdr *);
61bcc6
 extern bfd_boolean _bfd_elf_write_secondary_reloc_section
61bcc6
Only in binutils-2.30/bfd: elf-bfd.h.orig
61bcc6
diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
61bcc6
--- binutils.orig/bfd/elf.c	2021-05-19 15:05:30.989901257 +0100
61bcc6
+++ binutils-2.30/bfd/elf.c	2021-05-19 15:05:55.478815712 +0100
61bcc6
@@ -11663,7 +11663,8 @@ _bfd_elf_init_secondary_reloc_section (b
61bcc6
 bfd_boolean
61bcc6
 _bfd_elf_slurp_secondary_reloc_section (bfd *      abfd,
61bcc6
 					asection * sec,
61bcc6
-					asymbol ** symbols)
61bcc6
+					asymbol ** symbols,
61bcc6
+					bfd_boolean dynamic)
61bcc6
 {
61bcc6
   const struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
61bcc6
   asection * relsec;
61bcc6
@@ -11728,7 +11729,10 @@ _bfd_elf_slurp_secondary_reloc_section (
61bcc6
 	      continue;
61bcc6
 	    }
61bcc6
 
61bcc6
-	  symcount = bfd_get_symcount (abfd);
61bcc6
+         if (dynamic)
61bcc6
+           symcount = bfd_get_dynamic_symcount (abfd);
61bcc6
+         else
61bcc6
+           symcount = bfd_get_symcount (abfd);
61bcc6
 
61bcc6
 	  for (i = 0, internal_reloc = internal_relocs, native_reloc = native_relocs;
61bcc6
 	       i < reloc_count;
61bcc6
Only in binutils-2.30/bfd: elf.c.orig
61bcc6
diff -rup binutils.orig/bfd/elfcode.h binutils-2.30/bfd/elfcode.h
61bcc6
--- binutils.orig/bfd/elfcode.h	2021-05-19 15:05:30.990901254 +0100
61bcc6
+++ binutils-2.30/bfd/elfcode.h	2021-05-19 15:07:34.098471218 +0100
61bcc6
@@ -1577,7 +1577,7 @@ elf_slurp_reloc_table (bfd *abfd,
61bcc6
     return FALSE;
61bcc6
 
61bcc6
   if (bed->slurp_secondary_relocs != NULL
61bcc6
-      && ! bed->slurp_secondary_relocs (abfd, asect, symbols))
61bcc6
+      && ! bed->slurp_secondary_relocs (abfd, asect, symbols, dynamic))
61bcc6
     return FALSE;
61bcc6
 
61bcc6
   asect->relocation = relents;
61bcc6
Only in binutils-2.30/bfd: elfcode.h.orig
61bcc6
Only in binutils-2.30/bfd: elfcode.h.rej