From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 2ECD838582AC for ; Mon, 13 Feb 2023 13:04:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2ECD838582AC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 154F921873 for ; Mon, 13 Feb 2023 13:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1676293455; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=99tBZzqlRhu72UDlTGFTbtHCjF0nhW9ORAxYJ/mrg9w=; b=ZUgSEpaF2lZCImwiBRMxwb8Zc6MkIqAW/79bP/NfE5if7FAomUneJx7l2TgecybhOAwG29 TUnnPcjJlAbgUMz0nUlYRYA55l+kymkLAisQdYOZPPuvVDtiraVf3IvCogE+tx4en36XSl 2r4ovxKcISdE8sg/606zH1h1FN1ZHoE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1676293455; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=99tBZzqlRhu72UDlTGFTbtHCjF0nhW9ORAxYJ/mrg9w=; b=cvbAA/Ug3BboetfIrVkul9MW4DEIykhjQBxNWR2yvzBPbT1tpHTVySCh/E/wFr3wSQSmAU Nu4ccQ1D9Fhsb7BQ== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0BD512C141 for ; Mon, 13 Feb 2023 13:04:15 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 00C8C63B1; Mon, 13 Feb 2023 13:04:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id F33E562DA for ; Mon, 13 Feb 2023 13:04:14 +0000 (UTC) Date: Mon, 13 Feb 2023 13:04:14 +0000 (UTC) From: Michael Matz To: binutils@sourceware.org Subject: [PATCH, obvious] Fix PR30079: abort on mingw Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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