Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2742984ybc; Mon, 25 Nov 2019 03:29:44 -0800 (PST) X-Google-Smtp-Source: APXvYqxKxPj9SenmUqCGma+Z62gqchx/DZP9xdw//el0A4/HjdAHVfX5fN0SQbjEhO8ouv8vCFnU X-Received: by 2002:a17:906:6006:: with SMTP id o6mr36232452ejj.51.1574681384497; Mon, 25 Nov 2019 03:29:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574681384; cv=none; d=google.com; s=arc-20160816; b=X/Hov9/Y38giOoTmWgb3JX0GMfaANxukICMXB9h03ArANSB5RtGrub6L5bbOJpzMhC W+NfrewecUKxq7ulZjlpfNfkj8CExIJyGDJXXc32D2z1miGzgTiSp51v7ulh8CcgZvtH wWr0SjBzDpFbHOwEXpXlnQAGBMcysaHa1BlFQNmbmuKaJ8jqgmel4iDezUl/f39/fr3M 761gCKVaoVY/rwLWV0lXkfDClpFfpG7yZ+TV1Cd3vx6WgGrgKBG8Antf0ty7i3h5TSWm dLbhyQGuLFc1+odM7FZ6+aNk8I9Bu3YsLBHRPRXra8Qd8yus3xgVrOEq2L3whTUkwYQY M2Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Z3F93sBZlkgbew0VoZqYHRKzpKsx1mBT5FYTlhriW6U=; b=uWG/tEXaZs1VD/9eNpwJej8YkD/Oo9VSeDmASMr5ThIcqSw08/GFn113NzKbEzhx+k TpWU6Bwx4f4362yXQFkIOEVZONH5UkK2msa3oCAoSNkV9XJl8Yu2rcAUo2G/FmQEXTBy ilu9X+AcvpCZZZhFs4eseb989aX4XMR3wP5Hf5atYgfB3ITOqkqXO1dFA4RgTRM8D6I/ uvftDXhMKgTloESWlXIyRJFl0Zw5r1fYC3gvGWcW71/w4vcLPZJHeJUtrSQGH2IbOOtv MVIbVowcG04qJEOb4788ICx87nRNaf08tlyE5QF7tZkUZ9KWa3EkwM2ZFmgbWglhc5mW N7Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xvWGAkj0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si5431576edm.231.2019.11.25.03.29.20; Mon, 25 Nov 2019 03:29:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xvWGAkj0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727295AbfKYJqG (ORCPT + 99 others); Mon, 25 Nov 2019 04:46:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:47062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727133AbfKYJqF (ORCPT ); Mon, 25 Nov 2019 04:46:05 -0500 Received: from linux-8ccs (x2f7fe0e.dyn.telefonica.de [2.247.254.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57B33207FD; Mon, 25 Nov 2019 09:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574675165; bh=SmxMpsS12PjFHRDcNUQ51+o9OMvfqAy4ZRREUthu25g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xvWGAkj0GDfi1tdbON1LdGTuWpZ7O3xx+xtdatiaaVC5Z/ZP3CCu0JVVUdXk2md58 DCS7MHQ6CfmFWRCEFgGQudELFUuHJgXYbbktG/PuB7DbCbEyMqZjvj2zpjEJCKHIPV U2gHjfoUmoswHcLmzhR82lhiIIJ7CeuS4ZQuTBQ4= Date: Mon, 25 Nov 2019 10:45:58 +0100 From: Jessica Yu To: Rasmus Villemoes Cc: Masahiro Yamada , Linux Kernel Mailing List , Matthias Maennich , Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Catalin Marinas , "binutils@sourceware.org" Subject: Re: [PATCH] export.h: reduce __ksymtab_strings string duplication by using "MS" section flags Message-ID: <20191125094557.GA31961@linux-8ccs> References: <20191120145110.8397-1-jeyu@kernel.org> <93d3936d-0bc4-9639-7544-42a324f01ac1@rasmusvillemoes.dk> <20191121160919.GB22213@linux-8ccs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-OS: Linux linux-8ccs 5.4.0-rc5-lp150.12.61-default+ x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Rasmus Villemoes [25/11/19 10:29 +0100]: >cc += binutils ML > >[on @progbits v %progbits in generic (data only) assembly code] > >On 22/11/2019 12.44, Masahiro Yamada wrote: >> On Fri, Nov 22, 2019 at 1:09 AM Jessica Yu wrote: >>> > >>> I think this would work, and it feels like the more correct solution >>> especially if arm isn't the only one with the odd progbits char. It >>> might be overkill if it's just arm that's affected though. I leave it >>> to Masahiro to see what he prefers. >>> >> >> >> BTW, is there any reason why >> not use %progbits all the time? >> >> >> include/linux/init.h hard-codes %progbits >> >> #define __INITDATA .section ".init.data","aw",%progbits >> #define __INITRODATA .section ".init.rodata","a",%progbits >> >> >> So, my understanding is '%' works for all architectures, >> but it is better to ask 0-day bot to test it. > >It seems that you're absolutely right. The binutils source has code like > >+ if (*input_line_pointer == '@' || *input_line_pointer == '%') >+ { >+ ++input_line_pointer; >+ if (strncmp (input_line_pointer, "progbits", >+ sizeof "progbits" - 1) == 0) >+ { >+ type = SHT_PROGBITS; >+ input_line_pointer += sizeof "progbits" - 1; >+ } >+ else if (strncmp (input_line_pointer, "nobits", >+ sizeof "nobits" - 1) == 0) >+ { >+ type = SHT_NOBITS; >+ input_line_pointer += sizeof "nobits" - 1; >+ } Yeah, I saw this too while digging. I also came across this commit in the binutils source: commit ecc054c097e7ced281d02ef9632eb0261a410b96 Author: Thomas Preud'homme Date: Fri Mar 2 11:51:34 2018 +0000 [GDB/testsuite] Use %progbits in watch-loc.c While using @progbits in .pushsection work on some targets, it does not work on arm target where this introduces a comment. This patch replaces its use in gdb.dlang/watch-loc.c and gdb.mi/dw2-ref-missing-frame-func.c by %progbits which should work on all targets since it is used in target-independent elf/section7.s GAS test. 2018-03-02 Thomas Preud'homme gdb/testsuite/ * gdb.dlang/watch-loc.c: Use %progbits instead of @progbits. * gdb.mi/dw2-ref-missing-frame-func.c: Likewise. So that seems to confirm this theory :-) I'm just surprised it isn't documented anywhere it seems. >The only reason I thought one needed to do it differently on ARM is this >from the gas docs: > >=== > The optional TYPE argument may contain one of the following >constants: > >'@progbits' > section contains data >... > Note on targets where the '@' character is the start of a comment (eg >ARM) then another character is used instead. For example the ARM port >uses the '%' character. >=== > >That doesn't suggest the possibility that % or some other character >might work on all architectures. > >Jessica, can you resend using just %progbits to let kbuild chew on that? >Please include a comment about the misleading gas documentation. Yup, sounds good. Thanks! Jessica