Blame SOURCES/gdb-rhbz1818011-bfd-gcc10-error.patch

b2f73e
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
b2f73e
From: Kevin Buettner <kevinb@redhat.com>
b2f73e
Date: Wed, 8 Apr 2020 16:15:52 -0400
b2f73e
Subject: gdb-rhbz1818011-bfd-gcc10-error.patch
b2f73e
MIME-Version: 1.0
b2f73e
Content-Type: text/plain; charset=UTF-8
b2f73e
Content-Transfer-Encoding: 8bit
b2f73e
b2f73e
;; Fix int conversion error from bfd/elf.c when compiling with gcc 10
b2f73e
b2f73e
Original commit message from H.J. Lu <hjl.tools@gmail.com> is below:
b2f73e
b2f73e
bfd: Change num_group to unsigned int
b2f73e
b2f73e
elf.c failed with to with GCC 10 as of
b2f73e
b2f73e
commit 906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536
b2f73e
Author: Martin Liska <mliska@suse.cz>
b2f73e
Date:   Tue Mar 24 11:40:10 2020 +0100
b2f73e
b2f73e
    Improve endianess detection.
b2f73e
b2f73e
            PR lto/94249
b2f73e
            * plugin-api.h: Add more robust endianess detection.
b2f73e
b2f73e
binutils-gdb/bfd/elf.c: In function ‘setup_group’:
b2f73e
binutils-gdb/bfd/elf.c:740:35: error: overflow in conversion from ‘unsigned int’ to ‘int’ changes value from ‘num_group = 4294967295’ to ‘-1’ [-Werror=overflow]
b2f73e
  740 |     elf_tdata (abfd)->num_group = num_group = -1;
b2f73e
      |                                   ^~~~~~~~~
b2f73e
cc1: all warnings being treated as errors
b2f73e
make[2]: *** [Makefile:1608: elf.lo] Error 1
b2f73e
b2f73e
Change num_group in elf_obj_tdata to unsigned int to compile with GCC 10.
b2f73e
b2f73e
	PR binutils/25717
b2f73e
	* elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
b2f73e
b2f73e
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
b2f73e
--- a/bfd/elf-bfd.h
b2f73e
+++ b/bfd/elf-bfd.h
b2f73e
@@ -1937,7 +1937,7 @@ struct elf_obj_tdata
b2f73e
   struct sdt_note *sdt_note_head;
b2f73e
 
b2f73e
   Elf_Internal_Shdr **group_sect_ptr;
b2f73e
-  int num_group;
b2f73e
+  unsigned int num_group;
b2f73e
 
b2f73e
   /* Index into group_sect_ptr, updated by setup_group when finding a
b2f73e
      section's group.  Used to optimize subsequent group searches.  */