]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix read_ranges for 32-bit long
authorJoseph Myers <joseph@codesourcery.com>
Fri, 17 Nov 2023 17:04:14 +0000 (17:04 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 17 Nov 2023 17:04:14 +0000 (17:04 +0000)
bfd/dwarf2.c:read_ranges compares bfd_vma values against -1UL, which
doesn't work correctly when long is 32-bit and bfd_vma is 64-bit
(observed as "nm -l" being very slow for mingw64 host; probably causes
issues on 32-bit hosts as well as IL32LLP64 cases such as mingw64).
Fix by using (bfd_vma) -1 in place of -1UL, as done elsewhere.

bfd/dwarf2.c

index b135ef091209552bd595b0e606a213fc25162231..22e6b4675987d843c6ca735440c092fadfd82852 100644 (file)
@@ -3688,7 +3688,7 @@ read_ranges (struct comp_unit *unit, struct arange *arange,
 
       if (low_pc == 0 && high_pc == 0)
        break;
-      if (low_pc == -1UL && high_pc != -1UL)
+      if (low_pc == (bfd_vma) -1 && high_pc != (bfd_vma) -1)
        base_address = high_pc;
       else
        {