Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4080970pxk; Tue, 29 Sep 2020 13:52:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2UQ69VQKIdEt+vFnvKsAzEU3Ti3Dy/NOHGPnWEQP7INDjip8lnBwIQnKKNL3MXNLzcFoX X-Received: by 2002:a17:906:5299:: with SMTP id c25mr5713995ejm.508.1601412729192; Tue, 29 Sep 2020 13:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601412729; cv=none; d=google.com; s=arc-20160816; b=mOF7zUsN2nG7i5XCu/ClGH/avKI1v52iLSUyMKsnz6Umk09U1DwQ82alYLrCG6/MxJ uTu4cmJFtkzYwkmiGrmDaJlx6sUs4/qi/1hJN42AJu6Yt9aMbgnBkFBygfr4j0anoZNX +W3v35p7FWL7MyUOT/LxdhJABzYpzVNauwcalBwxifjUVoyfenvzN0EIkE0Q47XcsKA/ vQ5Zu8m4xacGdB/BWHQXeN1bcJ+8CitB0vQsQfj87UD70T8cwe/HXa/Mfh56Iz4iFbqh L3jcpdVygc35M2Ka5nof/PCNiDXBcz+RK7hhg7GBZpxiXSTY1vhqIF2rvdEFL1oaYsar rFRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:sender:dkim-signature; bh=V3P4F4QWiuS/mi/zwuxmKRL+xPQc9F0a3ah2tRd6rKw=; b=arbmFNljvB6adQzse0leo/fmmDefWAmLl/fXbFBLC7Ryb1J9qj24PNoslxQLKNn+r1 ViUqNDXIr3Zax0HOIhd+XR0DIGNBJCYjvGcGA6Nc3szvYfWOyXEtOguKjFmJtIQGydo8 2kRK5KaKYUabnPSd6upDF+g81HfjdkVxytJydtsyAxN6Ac64v/jlKtCjqVbbWRcT/H1M YnYsMPTK8LcOgunHLfcc3eUcmjmoTJkH9XXCie7pplHh2QWYSD4J+yDeb3tGbAU/yZSN 507zxae6WXXHI6bJQmVrUWlEUW4ACbTK+qa2fZcaa09INf6s24PUQUvhI8CHJzpUljsD XHdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vTYMep3x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a25si3426636ejx.145.2020.09.29.13.51.45; Tue, 29 Sep 2020 13:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vTYMep3x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729363AbgI2Urv (ORCPT + 99 others); Tue, 29 Sep 2020 16:47:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728907AbgI2Urv (ORCPT ); Tue, 29 Sep 2020 16:47:51 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D814C061755; Tue, 29 Sep 2020 13:47:51 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id cy2so3054924qvb.0; Tue, 29 Sep 2020 13:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=V3P4F4QWiuS/mi/zwuxmKRL+xPQc9F0a3ah2tRd6rKw=; b=vTYMep3x7skP/KJWvFFLIt273NsL+ED/CoxGQh1gMmwkoEds7iSTZ6UShchFs72/nz aZenBI+5VFJ4UgMk+QAmhiURn+oX+2EktjvIABTP9VQsIEXhjGrYo0D8h8OVBj+rlsat gyvdqo0dS7pTDP1MBsAZrRB2MThsibWF8xwXd53qOg2sygdMccIOGR6/co4JzAd/lJxK WNqXbGxbvjww4Z1neykbg4OTwy9+LDr1XY4P7zT208/h2U5z3mf5eOvMgdgYtFV92ql2 q3xx/6ble05mIBSdqPE8hhs+gq/gt5OFe5YIxeOMZI49xVOC80TZ2YGyVhCEQi9TS2MO VmuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=V3P4F4QWiuS/mi/zwuxmKRL+xPQc9F0a3ah2tRd6rKw=; b=h7Yp0l2nJbTPp8UJi8ZxqzdH66Ae9JrQ7SMkHZNUP+0EQtRKNmcHH1fXHYmNOSe6a7 W48KihfOwpjTREsdXYR7PfVm59Es7JgdG3WnUBmEPFt1+GMLLUGQap/DTP0kyvC3fJC3 s44lYCgPNA6eMEa746PcwmK7bxtul853DINyWska5KDTWHzarno8tLBhj+2Qn8h0ylIs 0sHi081eNKWhw/Q11Futg7XydXwxxBlQbfpXd2JbCqTywzMqk3ozoAsfI5re6moSHhNZ tXns6N18SxpuFjb9KlTkmER+zVmTvTBZP5Da+zgn51sezL4zMOt1UZUSD/29KusscpaS X+zw== X-Gm-Message-State: AOAM533TNWQhhDD+ztR1RRBvCdPYp7f0cbppP/VmNiqmm/CElGV+V/l7 /+hmIUBpInMygMi2WeSjWfQ= X-Received: by 2002:ad4:408f:: with SMTP id l15mr6401654qvp.4.1601412470319; Tue, 29 Sep 2020 13:47:50 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id m18sm5964723qkg.77.2020.09.29.13.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 13:47:49 -0700 (PDT) Sender: Arvind Sankar From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 29 Sep 2020 16:47:48 -0400 To: Nick Desaulniers Cc: Arvind Sankar , Andrew Morton , Miguel Ojeda , Luc Van Oostenryck , Nathan Chancellor , linux-sparse@vger.kernel.org, LKML , clang-built-linux , Joe Perches Subject: Re: [PATCH] compiler.h: avoid escaped section names Message-ID: <20200929204748.GA2683578@rani.riverdale.lan> References: <20200929194318.548707-1-ndesaulniers@google.com> <20200929200801.GA2668747@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 29, 2020 at 01:30:22PM -0700, Nick Desaulniers wrote: > On Tue, Sep 29, 2020 at 1:25 PM Nick Desaulniers > wrote: > > > > On Tue, Sep 29, 2020 at 1:08 PM Arvind Sankar wrote: > > > > > > On Tue, Sep 29, 2020 at 12:43:18PM -0700, Nick Desaulniers wrote: > > > > The stringification operator, `#`, in the preprocessor escapes strings. > > > > For example, `# "foo"` becomes `"\"foo\""`. GCC and Clang differ in how > > > > they treat section names that contain \". > > > > > > > > The portable solution is to not use a string literal with the > > > > preprocessor stringification operator. > > > > > > > > In this case, since __section unconditionally uses the stringification > > > > operator, we actually want the more verbose > > > > __attribute__((__section__())). > > > > > > > > Link: https://bugs.llvm.org/show_bug.cgi?id=42950 > > > > Fixes: commit e04462fb82f8 ("Compiler Attributes: remove uses of __attribute__ from compiler.h") > > > > Signed-off-by: Nick Desaulniers > > > > --- > > > > include/linux/compiler.h | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/include/linux/compiler.h b/include/linux/compiler.h > > > > index 92ef163a7479..ac45f6d40d39 100644 > > > > --- a/include/linux/compiler.h > > > > +++ b/include/linux/compiler.h > > > > @@ -155,7 +155,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, > > > > extern typeof(sym) sym; \ > > > > static const unsigned long __kentry_##sym \ > > > > __used \ > > > > - __section("___kentry" "+" #sym ) \ > > > > + __attribute__((__section__("___kentry+" #sym))) \ > > > > = (unsigned long)&sym; > > > > #endif > > > > > > > > -- > > > > 2.28.0.709.gb0816b6eb0-goog > > > > > > > > > > There was this previous mini-thread: > > > https://lore.kernel.org/lkml/20200629205448.GA1474367@rani.riverdale.lan/ > > > and this older one: > > > https://lore.kernel.org/lkml/20190904181740.GA19688@gmail.com/ > > > > > > Just for my own curiosity: how does KENTRY actually get used? grep > > > doesn't show any hits, and the thread from 2019 was actually going to > > > drop it if I read it right, and also just remove stringification from > > > the __section macro. > > > > Oh, sorry I didn't respond on that thread; I could have sworn I ran a > > grep for KENTRY back then. > > > > $ git log -S KENTRY > > Added by > b67067f1176df6ee727450546b58704e4b588563 ? > Yeah but nothing seems to have used it. I assume for LTO we use some other technique to mark functions as used?