From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id D308B3858C52 for ; Mon, 28 Nov 2022 02:12:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D308B3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x52f.google.com with SMTP id f9so8684457pgf.7 for ; Sun, 27 Nov 2022 18:12:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=97XJNDUG2RrGb03H+80lllf3XLahu3k8FW+1GOOdyxw=; b=kNkHH/6PmWKQVuYgEA6FOtUFttcUYwA0tnOO2w8rL3Z8HY+Km9wqAHL5DCUSXn6YF3 17ncfx2wnNHdaAtRZ3H5+0uo6zk3fROnQIpErwQHtw1bs8dhVgqOQdr9+2ypRcXIozqu yzY2lQ2ViEAeJEIVJT6gkqgRLXPn/A+Nz8To0KOK/1w4X/A4yrhCIS+WPQjDicT87TXR DKFeD+gWboOVzkbfyYpB6PFFcCtM43JU+jvf7YfH1Flmda/PAHmZ0B+ppAN3OPt14lx1 W+wGo1D5a8S0oLL2QyImWVlWVBEghMEPnFxg6myRW8X9H3QDRgAkICQ2Wa/1fbJQhBug LTCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=97XJNDUG2RrGb03H+80lllf3XLahu3k8FW+1GOOdyxw=; b=GPxCMyzdJWvZDWcwulRiJtW2oUuoSRCAAoLOb9sdttVbCRDCbES2yxbwAZ/hBiXmWC kyI0H4X0IrrGeJC+1qLAizUyV7M1bvUVAMDkumR1k8qhhN+X5ofMFmR/hewAZTygiCma xjxcdWAuqIU/YcYOn/z0JhNauJvHN/iszZfyi5R/M0bJUBTnJGN2zCn0nSP2u/3odZa8 NcjyqXWlf1bZHpc4XDd8IriPps7gIzmnZJIDDLXLOqfqoLdlJMJEwaAKP0LvXERwRnM3 B2QQA/i8aWm3AS5beTf1QgC1wPDUN/NW9ivxcq4nkRHKWYbIEr7rYotsd32+37X+iHps u7VA== X-Gm-Message-State: ANoB5pn8sSiua77tYPfoxirjPJzhYfKSzeld5N419MUanEJU+YuiJ489 eU0Z9pdb2JkwH13WUnvrC6PFkgubWy0= X-Google-Smtp-Source: AA0mqf58vB3vk4Th9lmy+IxpHMYaQ1cqtT0MufZBSi2+LS7kOrYbNllDMcnYRmOdb+/nbzBeIr7eig== X-Received: by 2002:a63:1747:0:b0:478:1391:fd14 with SMTP id 7-20020a631747000000b004781391fd14mr3191768pgx.112.1669601562732; Sun, 27 Nov 2022 18:12:42 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id q29-20020aa7983d000000b0056c47a5c34dsm6761709pfl.122.2022.11.27.18.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 18:12:42 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 9850E1140503; Mon, 28 Nov 2022 12:42:39 +1030 (ACDT) Date: Mon, 28 Nov 2022 12:42:39 +1030 From: Alan Modra To: Michael Matz Cc: binutils@sourceware.org Subject: Re: [PATCH] Special case more simple patterns Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3030.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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: On Fri, Nov 25, 2022 at 04:01:58PM +0000, Michael Matz via Binutils wrote: > fnmatch is slow, so avoiding it in more cases is good. This implements > a more generic version of match_simple_wild which needs some > pre-processing of patterns. In particular it supports patterns of the > form PREFIX*SUFFIX (where all parts are optional), i.e. a super set of > what's handled now. Most section matchers of this form and hence don't > need any calls to fnmatch anymore. > > We retain the implementation of match_simple_wild for the filename > matchers (they aren't called often enough to matter). > --- > This is independendly useful, but will be used in the next-to-be-posted > series about section-select. OK, but please do put the comment for rstrcspn from your later patch in with this one, and don't commit the following two hunks. > @@ -645,6 +672,7 @@ walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr, > { > const char *sname = bfd_section_name (s); > bool skip = !match_simple_wild (wildsec0->spec.name, sname); > + //bool skip = !!spec_match (&wildsec0->spec, sname); > > if (!skip) > walk_wild_consider_section (ptr, file, s, wildsec0, callback, data); > @@ -682,6 +710,7 @@ walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr, > { > const char *sname = bfd_section_name (s); > bool skip = !match_simple_wild (wildsec1->spec.name, sname); > + //bool skip = !!spec_match (&wildsec1->spec, sname); > > if (!skip) > walk_wild_consider_section (ptr, file, s, wildsec1, callback, -- Alan Modra Australia Development Lab, IBM