Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4024141pxk; Tue, 29 Sep 2020 12:09:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ9suZZMUZbWAo6QNZ6XZQ/DtDkN9OkD8lzxUBv34Za/nFcRUl99pF3vpuEXb1eSERal2B X-Received: by 2002:a17:906:6007:: with SMTP id o7mr5609873ejj.550.1601406542403; Tue, 29 Sep 2020 12:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601406542; cv=none; d=google.com; s=arc-20160816; b=Maom7i0pQ58+EyeR4buWd0krRswhnZQTKVt3xq0sNSpALjqkgzLgcnZBgnra38zFzP scfA69uKf5KTf2a3eYC/OVT81zqjlQAX2Wz9VIyJfn9PSPr16cecs9uWBnPS43C+meli 7UiMC6okeJ5p9zzJEGR7aDjKkpt05nOufDnJitOvYhZJIgKBuTFRVNXTppk1rtE84LKY oiqkB576eoIZFNdXgdkZBKgB7ahYnbFi/I24YhbDDk8zCn5i2Hb71xVEmdWYBIoq1NS3 mz9DFw7/KuByE9JtYnK/5bZtRN/frmNTRZ7tqBgRW3oSMibocdLKx7yrqhMvNAGwgWGV 4ClA== 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=kK71kCSNGJVaDe2pNd17eTqrSe4R+0MFugjIL4jzDFc=; b=GUlZCtAjD+ss68lOvC0i5fQFLblhONhI1luxfIZeGOYWVF+JDjdRh+A53RRdrCh9AG Q5QlY0cpFlqQ760ZkE7FN1pq0uQ85aFPxX+3OvZUmanU54trKWAbpbMVTK1qCEVg/jMe M7yTxR4xE93PsNBMVy3041lfjoe7OB+/hk0AhNLAkngdM7k+drAJcnJ48x7jpEL4XU7b bZzG8ysXvCTZXFDt3FP0XuxM3TNK1kzH5J1VdL8zy8RG3mBXiIQZmU3s+BkUegXzsq4K ZAFapN9ZFMQAamARS/TyKf/IVLH7tAvzZ+q9TfRCBmMBLPWnSouoSSpn70rHTuaPyh4Q D2Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PfsZalFh; 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 l10si3214356edr.220.2020.09.29.12.08.37; Tue, 29 Sep 2020 12:09:02 -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=PfsZalFh; 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 S1728281AbgI2THU (ORCPT + 99 others); Tue, 29 Sep 2020 15:07:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727740AbgI2THT (ORCPT ); Tue, 29 Sep 2020 15:07:19 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA7FCC061755 for ; Tue, 29 Sep 2020 12:07:19 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id z40so5854364ybi.3 for ; Tue, 29 Sep 2020 12:07:19 -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=kK71kCSNGJVaDe2pNd17eTqrSe4R+0MFugjIL4jzDFc=; b=PfsZalFhEeBQpiATmlrk+FX19iTeTafrV6ltkUFI1L81IdRa3RE5BQxWSIu1MC9LGu At+oUMALCekjXOZdxE7QjZm9osZl6Bvt/Ec6HQwLSMvPKIMa0W3A1hIyHf2O03QcpOsu mPpIzo6bE1e9k1Pu2EpWJXZQtEWR0JXr/8YxSEPpCQRXIxVwnsQ7y1ZolUvb6fU9Kxxd ZTGv6E3a/FiaB1jzEhtKI5BiOazL7bMK/Ew7EQ/z3wMS+b+6vIZFtUO7/dXf+aD0W3EG UMD6cz2QzOBvjM9zP/aTFx8TrHrZgq3y0BAQ3JuaCk+VIPEf5di6QGR+HltkTNOfLLn7 eF9w== 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=kK71kCSNGJVaDe2pNd17eTqrSe4R+0MFugjIL4jzDFc=; b=kCLmyRkeTjsXA2kir7hi5Ob9H8lXISP6mDPFdj6jcfGOcMUiMQJKdChlXRUwychvdN kRt2pfjvxNh/1/od1nD3cAe5BgnN8Lexvs30kPiPQZVcUHE0hixU6pD8PisYukYtdDrA 4lcxrL8MM8yl6l4ToOdFvKd6CeSOT+MIV47JNOUMxHuERFMBsp/qEM/YcyXD6wFP71IO SSOG6WcVyqJc6X159fHni97BQmMd5kF9kZ7tm8zPZGbARQF6qSzsbIsHrjsQ1J3Vephq +nLnIULyTxzaoh6nQwveuy+BgatXzODGN2t0lN1O0Lh2Mf7aWjaCDGZETZo6o7JAypmD 46PA== X-Gm-Message-State: AOAM530W4wzrnvXnDnjSE1wox8OoB4P+u2wUqfO9jDCuaW1qFK0KPFIz /FXXY4meYvA7muAikySrvH04PbBMcuaYGZ8+X5E= 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:a25:ba4f:: with SMTP id z15mr8385000ybj.408.1601406438780; Tue, 29 Sep 2020 12:07:18 -0700 (PDT) Date: Tue, 29 Sep 2020 12:07:00 -0700 Message-Id: <20200929190701.398762-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [PATCH] export.h: fix section name for CONFIG_TRIM_UNUSED_KSYMS for Clang From: Nick Desaulniers To: Andrew Morton Cc: Nick Desaulniers , kbuild test robot , Kees Cook , Nathan Chancellor , Masahiro Yamada , Matthias Maennich , Jessica Yu , Greg Kroah-Hartman , Will Deacon , 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 When enabling CONFIG_TRIM_UNUSED_KSYMS, the linker will warn about the orphan sections: (".discard.ksym") is being placed in '".discard.ksym"' repeatedly when linking vmlinux. This is because the stringification operator, `#`, in the preprocessor escapes strings. 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. Link: https://bugs.llvm.org/show_bug.cgi?id=42950 Link: https://github.com/ClangBuiltLinux/linux/issues/1166 Fixes: commit bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS") Reported-by: kbuild test robot Suggested-by: Kees Cook Signed-off-by: Nick Desaulniers --- include/linux/export.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/export.h b/include/linux/export.h index fceb5e855717..8933ff6ad23a 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -130,7 +130,7 @@ struct kernel_symbol { * discarded in the final link stage. */ #define __ksym_marker(sym) \ - static int __ksym_marker_##sym[0] __section(".discard.ksym") __used + static int __ksym_marker_##sym[0] __section(.discard.ksym) __used #define __EXPORT_SYMBOL(sym, sec, ns) \ __ksym_marker(sym); \ -- 2.28.0.709.gb0816b6eb0-goog