From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by sourceware.org (Postfix) with ESMTPS id 7A8333858D32 for ; Tue, 26 Jul 2022 07:09:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A8333858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=martin.st Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=martin.st Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 26Q79bNU030446-26Q79bNV030446; Tue, 26 Jul 2022 10:09:38 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id 7E19DA143E; Tue, 26 Jul 2022 10:09:37 +0300 (EEST) Date: Tue, 26 Jul 2022 10:09:34 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: Jan Beulich cc: binutils@sourceware.org Subject: Re: [PATCH v2 1/2] ld: Add support for a new option, -exclude-symbols, in COFF object file directives In-Reply-To: <36a3fb2e-c06d-ef6c-93f7-18c5a88d71d1@suse.com> Message-ID: <7082e388-8c14-c741-4e66-4bc3d9639ab@martin.st> References: <20220722220203.1712670-1-martin@martin.st> <36a3fb2e-c06d-ef6c-93f7-18c5a88d71d1@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-FE-Policy-ID: 3:14:2:SYSTEM X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2022 07:09:44 -0000 On Mon, 25 Jul 2022, Jan Beulich wrote: > On 23.07.2022 00:02, Martin Storsjo wrote: >> This maps to the same as ld's --exclude-symbols command line option, >> but allowing specifying the option via directives embedded in the >> object files instead of passed manually on the command line. >> --- >> Fixed parsing multiple comma separated symbols. While pe_dll_add_excludes >> does tokenize the string, the symbol tokens in deffilep.y don't >> include commas, so we need to handle that at that level. > > This patch is about object files only, so doesn't all of this belong in the > next patch? Surprisingly, the def parser is used to tokenize the argument to the option in the embedded directive - in the previous patch, it only included the first symbol up to the first comma. So due to that, we'd either need a def parser token for "identifier string including commas", or do the comma splitting at the parser level. >> --- /dev/null >> +++ b/ld/testsuite/ld-pe/exclude-symbols-embedded.d >> @@ -0,0 +1,10 @@ >> +#source: exclude-symbols-embedded.s >> +#target: i*86-*-cygwin* i*86-*-pe i*86-*-mingw* > > What about x86-64 at the very least? That's the most common target nowadays, > i.e. also the one with the pest chances of catching regressions early. Sure, I can add that too, sorry for missing it. Here, i386 is the more interesting one though, as it has symbol prefixes, and the testcase defines how that's handled. But I'll add an x86_64 one too. > Also while I realize that there are several uses of i*86-* there already, I think > that's a little too broad. Can I talk you into using i?86-* instead? Sure, I can absolutely change that. That was just a copypaste from some other test. // Martin