Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4043873pxk; Tue, 29 Sep 2020 12:45:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaAnvQJfgZvKaxr0y6eaNx1LfObS8KGrVXpn3t0UJnSqWorPlUG2m2l5zOESw9FsErpzq5 X-Received: by 2002:a05:6402:10c7:: with SMTP id p7mr5127306edu.34.1601408701642; Tue, 29 Sep 2020 12:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601408701; cv=none; d=google.com; s=arc-20160816; b=Y2KtY2Xvx8laavRsrRW8HH3PpXnRaYA+REtS58GizYPmzgOZgnHAs3UEp5KBHnKA8N YmU9UQhR5N52pSxckdpM0ysBE6aNdvwMHd/pA24YDcvFN8yzsZMc4DM0P5E3vnRWXs+7 PuUtIqhP6xGB4wxekwxDxYYQaHrwgqZQC2ZMvwJHAIye57mcBwkqUs345JehdGISbmZu eDW4DVGLXEsfRqnsxQpUh0MR99q+cbeY+1xMfTETaq+z28E0bb1Rp2lOn8Qz5rJjHRkg r8F2ncthWibbJn0n8ztDeQDmhlvLRgRJ6R3ibHQ3aCD5H+9WCQv1K0EdPb7hfku41k/E B0Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=L+ZQTMyUzbfAF4MuXzem6ruOy1jTior618txOZRQrDw=; b=M5yFkz1ECfx2he9JA9H6mXa1bjpikMmD57mSKU7/SSkk+YScr0AigFWpNHPQjaVcmB 0bJleqr7Ddsd1DF9LGMfaJsFLz303jNsCXZMl4iUImvNjx9IOGkdIb1vENHdRekzBxtR dDlbDQ+BaUKaQWyoxJRv720N3/oJ3Tcf1x8BPl6khugJ1NzdwXxInW9CyQC5p56zdUbn Jd8qRGpqIHPK1URSPwPiDkpU4snzJ3QCUpjH0DBz5jB1s2JSPRO739ZZ2cB8gGBBKL1F b4672jKZfjSx8Y+n8DTxDlD5tCW5vUKzN7Lo3rk39zSKFq5p3gGlZhfESCYKjrgwRRZl m53w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JemOKWyu; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i88si3353713edd.601.2020.09.29.12.44.38; Tue, 29 Sep 2020 12:45:01 -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=@google.com header.s=20161025 header.b=JemOKWyu; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728426AbgI2Tn0 (ORCPT + 99 others); Tue, 29 Sep 2020 15:43:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727740AbgI2Tn0 (ORCPT ); Tue, 29 Sep 2020 15:43:26 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57BFEC061755 for ; Tue, 29 Sep 2020 12:43:24 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id o11so4307765pjj.9 for ; Tue, 29 Sep 2020 12:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=L+ZQTMyUzbfAF4MuXzem6ruOy1jTior618txOZRQrDw=; b=JemOKWyuOxhCUEgCq4LBeWvD9B32/OB1HfIHGAAvckrTpq5LIvBiCbRxwut5xE9GQC I/JldAYejW65SqHWDgvHvxerNRwDBLsXyMM+Dt+L5JuB5GCPpRUXw+RCKyk3Ksx5pqLW AhNOAiW8tmlj1kXInhu2megrBHMi+RnlZqpSjpPjNDtHh2oN0df0yIr4VH4A9Xh+tyCU 1EiH/TjvUzM8GS7CRv9lSwl6qBz97BcGLKw//F+BsHJ5E93w2ancnfTwPc1cifM8wNYY MTMfoOi4ezt13lJAe/mSWgyD3p5bnAIf8juKQ0G4eW+/X0JoVhbzTIjxukpW2XDQvv9r O4TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=L+ZQTMyUzbfAF4MuXzem6ruOy1jTior618txOZRQrDw=; b=J7l6kN7oe/LuPPxSxcsRXEpYJbps/NjBzHyF9Yy2ZEjnsrx2I9sqQxDT7p9peUlM4+ yNCcDLLlejxzXduZ998L2ihXZstW9WXNF0YLRl8hOHW+A1qyfNaN3XkWogjUpgquUkHb 4D8Zek7JpxgkH0RcK45AbBP/utb2/eDHuXTfMjiAkdXqqrcmWBlcHUYX3RzfWAWZgyHe WwMCUAFl6I6diXvdQ0LYxNvRskfJnuzEX3KqTcCXjjS3bElEAuIj1WkKmy1CZWMrtJrw dgZqJuQVMU15KHHoFKKCjO7bRM3k9MkjkS+sutmCTGZN+/5o3iH7PFRkiojZw9QnEa+/ kMfA== X-Gm-Message-State: AOAM531S/NTntvhMNbUmFn/BZU3p0+KnwyrecWKsZehUq4B56wtn04uA AYu8h2p1yXv+VElr0iqqmTalfscJAIyKq3NmFJg= Sender: "ndesaulniers via sendgmr" X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:f693:9fff:fef4:4d25]) (user=ndesaulniers job=sendgmr) by 2002:a62:2c09:0:b029:142:2501:34f8 with SMTP id s9-20020a622c090000b0290142250134f8mr5448080pfs.81.1601408603686; Tue, 29 Sep 2020 12:43:23 -0700 (PDT) Date: Tue, 29 Sep 2020 12:43:18 -0700 Message-Id: <20200929194318.548707-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [PATCH] compiler.h: avoid escaped section names From: Nick Desaulniers To: Andrew Morton Cc: Miguel Ojeda , Nick Desaulniers , Luc Van Oostenryck , Nathan Chancellor , linux-sparse@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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