From: Michael Matz <matz@suse.de>
To: binutils@sourceware.org
Subject: [PATCH, obvious] Fix PR30079: abort on mingw
Date: Mon, 13 Feb 2023 13:04:14 +0000 (UTC) [thread overview]
Message-ID: <alpine.LSU.2.20.2302131301550.29328@wotan.suse.de> (raw)
the early-out in wild_sort is not enough, it might still be
that filenames are equal _and_ the wildcard list doesn't specify
a sort order either. Don't call compare_section then.
Tested on all targets.
---
committed as obvious after convincing myself that I had a thinko here.
ld/ldlang.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 84a2914fc26..b5e0d026ae4 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -649,7 +649,8 @@ wild_sort (lang_wild_statement_type *wild,
looking at the sections for this file. */
/* Find the correct node to append this section. */
- if (compare_section (sec->spec.sorted, section, (*tree)->section) < 0)
+ if (sec && sec->spec.sorted != none && sec->spec.sorted != by_none
+ && compare_section (sec->spec.sorted, section, (*tree)->section) < 0)
tree = &((*tree)->left);
else
tree = &((*tree)->right);
--
2.39.1
reply other threads:[~2023-02-13 13:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=alpine.LSU.2.20.2302131301550.29328@wotan.suse.de \
--to=matz@suse.de \
--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).