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

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