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.
This commit is contained in:
Jan Beulich 2021-06-07 08:37:42 +02:00
parent 53f18dfd3e
commit 6bee34a1dc
4 changed files with 11 additions and 3 deletions

View file

@ -7284,7 +7284,7 @@ display_debug_aranges (struct dwarf_section *section,
start = end_ranges;
while (2 * address_size <= (size_t) (start - addr_ranges))
while (2u * address_size <= (size_t) (start - addr_ranges))
{
SAFE_BYTE_GET_AND_INC (address, addr_ranges, address_size, start);
SAFE_BYTE_GET_AND_INC (length, addr_ranges, address_size, start);