aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-06-07 08:37:42 +0200
committerJan Beulich <jbeulich@suse.com>2021-06-07 08:48:26 +0200
commit6bee34a1dc94dcfbf84b6318a731e6b059b39977 (patch)
treea7c9b95437b8a88d1a68da4b0139c3f65330a269 /bfd
parent53f18dfd3e790c6320db7496252921dbd26a086b (diff)
downloadgdb-6bee34a1dc94dcfbf84b6318a731e6b059b39977.zip
gdb-6bee34a1dc94dcfbf84b6318a731e6b059b39977.tar.gz
gdb-6bee34a1dc94dcfbf84b6318a731e6b059b39977.tar.bz2
fix Dwarf2 build with certain gcc versions
Older gcc reports: .../bfd/dwarf2.c: In function 'read_ranges': .../bfd/dwarf2.c:3107: error: comparison between signed and unsigned .../bfd/dwarf2.c: In function 'read_rnglists': .../bfd/dwarf2.c:3189: error: comparison between signed and unsigned Similarly for binutils/dwarf.c. Arrange for the left sides of the > to also be unsigned quantities.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/dwarf2.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7857b70..04e3679 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-07 Jan Beulich <jbeulich@suse.com>
+
+ * dwarf2.c (read_ranges, read_rnglists): Add u suffix to constant.
+
2021-06-02 Alan Modra <amodra@gmail.com>
* elf-attrs.c (_bfd_elf_parse_attributes): Break out of loop if
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 4b169fc..79fcd06 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -3104,7 +3104,7 @@ read_ranges (struct comp_unit *unit, struct arange *arange,
bfd_vma high_pc;
/* PR 17512: file: 62cada7d. */
- if (2 * unit->addr_size > (size_t) (ranges_end - ranges_ptr))
+ if (2u * unit->addr_size > (size_t) (ranges_end - ranges_ptr))
return false;
low_pc = read_address (unit, &ranges_ptr, ranges_end);
@@ -3186,7 +3186,7 @@ read_rnglists (struct comp_unit *unit, struct arange *arange,
break;
case DW_RLE_start_end:
- if (2 * unit->addr_size > (size_t) (rngs_end - rngs_ptr))
+ if (2u * unit->addr_size > (size_t) (rngs_end - rngs_ptr))
return false;
low_pc = read_address (unit, &rngs_ptr, rngs_end);
high_pc = read_address (unit, &rngs_ptr, rngs_end);