aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-03-24 06:58:40 -0700
committerAndreas K. Hüttel <dilfridge@gentoo.org>2020-05-08 20:44:08 +0300
commitd88245ccaefae13b2b99aa7257aaf9d047b344ad (patch)
treed7f86a0201152630d78ab275db342a4d8d6c2d68
parentgas, arm: Fix bad backport (diff)
downloadbinutils-gdb-d88245ccaefae13b2b99aa7257aaf9d047b344ad.tar.gz
binutils-gdb-d88245ccaefae13b2b99aa7257aaf9d047b344ad.tar.bz2
binutils-gdb-d88245ccaefae13b2b99aa7257aaf9d047b344ad.zip
bfd: Change num_group to unsigned int
elf.c failed with to with GCC 10 as of commit 906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536 Author: Martin Liska <mliska@suse.cz> Date: Tue Mar 24 11:40:10 2020 +0100 Improve endianess detection. PR lto/94249 * plugin-api.h: Add more robust endianess detection. binutils-gdb/bfd/elf.c: In function ‘setup_group’: 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] 740 | elf_tdata (abfd)->num_group = num_group = -1; | ^~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [Makefile:1608: elf.lo] Error 1 Change num_group in elf_obj_tdata to unsigned int to compile with GCC 10. PR binutils/25717 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int. (cherry picked from commit cda7e5603f6efd7c3716e45cc6ea11b70dd8daae) (cherry picked from commit a560c29ca5a6eeb7f84452f781f838ab35fd844b)
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf-bfd.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index fd102a9cfe..f8abe540ba 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/25717
+ * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
+
2020-03-11 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index cbbba153f4..1550a08b31 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1937,7 +1937,7 @@ struct elf_obj_tdata
struct sdt_note *sdt_note_head;
Elf_Internal_Shdr **group_sect_ptr;
- int num_group;
+ unsigned int num_group;
/* Index into group_sect_ptr, updated by setup_group when finding a
section's group. Used to optimize subsequent group searches. */