From: Joseph Myers <joseph@codesourcery.com>
To: <binutils@sourceware.org>
Subject: Fix read_ranges for 32-bit long
Date: Thu, 16 Nov 2023 23:35:57 +0000 [thread overview]
Message-ID: <82567b93-7ea5-bdbf-2940-59ad7c658f61@codesourcery.com> (raw)
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.
---
OK to commit?
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index b135ef09120..22e6b467598 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -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
{
--
Joseph S. Myers
joseph@codesourcery.com
next reply other threads:[~2023-11-16 23:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 23:35 Joseph Myers [this message]
2023-11-17 9:12 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82567b93-7ea5-bdbf-2940-59ad7c658f61@codesourcery.com \
--to=joseph@codesourcery.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).