From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5700 invoked by alias); 19 Apr 2015 15:48:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 5690 invoked by uid 89); 19 Apr 2015 15:48:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 19 Apr 2015 15:48:09 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3JFlmI7025172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 19 Apr 2015 11:47:51 -0400 Received: from tucnak.zalov.cz (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3JFBlZD017953 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 19 Apr 2015 11:11:49 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t3JFBjpi030668; Sun, 19 Apr 2015 17:11:45 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t3JFBghw030667; Sun, 19 Apr 2015 17:11:42 +0200 Date: Sun, 19 Apr 2015 15:48:00 -0000 From: Jakub Jelinek To: Yury Gribov Cc: Andi Kleen , GCC Patches , Andrey Ryabinin , Dmitry Vyukov Subject: Re: [PATCH] Optionally sanitize globals in user-defined sections Message-ID: <20150419151142.GZ1725@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <5530B739.5000306@samsung.com> <5530B84E.7030709@samsung.com> <87vbgu1x4d.fsf@tassilo.jf.intel.com> <55335F51.3080900@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55335F51.3080900@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00968.txt.bz2 On Sun, Apr 19, 2015 at 10:54:57AM +0300, Yury Gribov wrote: > On 04/17/2015 08:29 PM, Andi Kleen wrote: > >Yury Gribov writes: > >>+ > >>+static bool > >>+section_sanitized_p (const char *sec) > >>+{ > >>+ if (!sanitized_sections) > >>+ return false; > >>+ size_t len = strlen (sec); > >>+ const char *p = sanitized_sections; > >>+ while ((p = strstr (p, sec))) > >>+ { > >>+ if ((p == sanitized_sections || p[-1] == ',') > >>+ && (p[len] == 0 || p[len] == ',')) > >>+ return true; > > > >No wildcard support? That may be a long option in some cases. > > Right. Do you think * will be enough or we also need ? and [a-f] syntax? libiberty contains and gcc build utilities already use fnmatch, so you should just use that (with carefully chosen FNM_* options). Jakub