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 C33E5384E394 for ; Fri, 25 Nov 2022 16:58:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C33E5384E394 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 09C4B21AF9 for ; Fri, 25 Nov 2022 16:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669395484; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GEUdRDmm4NO9++zSMGwaumt04faIthnKWt1XTPvIdZQ=; b=SXonuQ4ovQ2UepjP/HRibKKmOwZ2NgwzHHs8IZwqaVb7jsX1I59AchJlZIl+BiEzx9q384 ZoS0PaLRzMCtVe0w3v8y1jzYMxDHmld9hf2ZNoJs82QtYSKfXp4b9kO6MX4Is5t4X5Pbq7 zqlEi8LCeEzhKTWo2F2By554A/WZyPE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669395484; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GEUdRDmm4NO9++zSMGwaumt04faIthnKWt1XTPvIdZQ=; b=wzk1Mzad9jTyuZ7r+SCtC5kKO6eW1UyDMsfPdE/D+crIa429GLeNmckNdOeCTQz/TVTFsS SEbvvqupWCBt0YBA== 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 0586C2C141 for ; Fri, 25 Nov 2022 16:58:04 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id F41AC6586; Fri, 25 Nov 2022 16:58:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id F2CC46238 for ; Fri, 25 Nov 2022 16:58:03 +0000 (UTC) Date: Fri, 25 Nov 2022 16:58:03 +0000 (UTC) From: Michael Matz To: binutils@sourceware.org Subject: [PATCH 8/8] section-select: Fix exclude-file-3 In-Reply-To: Message-ID: References: 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=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,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: this testcase wasn't correctly testing everything, it passed, even though sections from an excluded file were included. Fixing this reveals a problem in the new section selector. This fixes that as well. --- ld/ldlang.c | 7 ++++--- ld/testsuite/ld-scripts/exclude-file-3.map | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ld/ldlang.c b/ld/ldlang.c index abaa9916256..4e9b93a83a7 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -422,6 +422,10 @@ walk_wild_section_match (lang_wild_statement_type *ptr, return; } + /* If filename is excluded we're done. */ + if (walk_wild_file_in_exclude_list (ptr->exclude_name_list, file)) + return; + /* Check section name against each wildcard spec. If there's no wildcard all sections match. */ sec = ptr->section_list; @@ -920,9 +924,6 @@ resolve_wilds (void) LANG_FOR_EACH_INPUT_STATEMENT (f) { //printf("XXX %s\n", f->filename); - /* XXX if (walk_wild_file_in_exclude_list (s->exclude_name_list, f)) - return;*/ - if (f->the_bfd == NULL || !bfd_check_format (f->the_bfd, bfd_archive)) resolve_wild_sections (f); diff --git a/ld/testsuite/ld-scripts/exclude-file-3.map b/ld/testsuite/ld-scripts/exclude-file-3.map index 389d1708c90..255182030ca 100644 --- a/ld/testsuite/ld-scripts/exclude-file-3.map +++ b/ld/testsuite/ld-scripts/exclude-file-3.map @@ -3,5 +3,7 @@ EXCLUDE_FILE\(\*-b\.o\) \*\(\.data \.data\.\*\) \.data +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-a\.o \.data\.1 +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-a\.o +#failif +.*data +0x[0-9a-f]+ +0x[0-9a-f]+ .*exclude-file-b.* -#... \ No newline at end of file +#... -- 2.36.1