Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4703694pxk; Wed, 30 Sep 2020 09:30:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdJW7/p2gfCOPdVCX/q4xvGnj113ZDICBQTOK9Reofa14UTaao3ZydkGjQSdahAQLRKu2K X-Received: by 2002:a50:cd5e:: with SMTP id d30mr3568552edj.190.1601483417498; Wed, 30 Sep 2020 09:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601483417; cv=none; d=google.com; s=arc-20160816; b=QHk1nu6T6cuJxEkogotdgNW8PUNB76Pl9cs00ZuouQK4dnagetxlAMcvVpXKR6wN/y kgtbYW4YS1gtiYvP+YEQRl8YKFzvTCIckRWSjYJbDZH0BMvb4be/CTB3ADArrZVSwTyF i/imNQZwn8LUtqiTTJeB8SjadsRCv9+tTLgk9r9Te76u80Ku2vUPRcu14TLpcRIEcE0N GSFqu4V48SY2QNehWOCwyFZarwXfJv01D1E+piAMDchYdIsOpzc9QUXj9aUHv0fH7rpp nadAaz8O6wGNzbcgLmz4V6+ouv1hwTjT5BOHqTkOxHR+BOFbcRRVgYLntSu0BNbf82xg TUag== 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:from:date:dkim-signature; bh=euGAurZX4qBq2rTxk1sS9112OK7Jtn1PkFhBEzUnB4Y=; b=QXZ39IeCRzrUls7b6wLRjJIxqJef1nJRMEzna0G2wweO/zvYxkv5mPUkyyDbpEKkFv 6xE1UoUviZjzJqfdIZROGWS718fLXqN8SBjj7+jVzLqf19fZk9+4LBcB005bJ79Q8ZBF VjSrovZYWl5j6r0UZo4oGxygRHqMIHpc33GItSAujgJWnHKL/jrpCy0I7tdFQJThKi5X v739Z4ksOEtiFMP+r3QVHuAxJxLESxBKk257Vbv7hCSXUO/wp0vDn5VMGo8wBVM9NOI3 wU9ub81JLxNkqv/ZoEY+QCnSK5V7PFyNomqWY4z4i9R60S+F042q2d5O6dbD8kBLWhOq /lew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b7dWSB7F; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si1435111edw.354.2020.09.30.09.29.54; Wed, 30 Sep 2020 09:30:17 -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=b7dWSB7F; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731093AbgI3Q0n (ORCPT + 99 others); Wed, 30 Sep 2020 12:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgI3Q0n (ORCPT ); Wed, 30 Sep 2020 12:26:43 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F18F2C061755 for ; Wed, 30 Sep 2020 09:26:41 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id l18so69910pjz.1 for ; Wed, 30 Sep 2020 09:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=euGAurZX4qBq2rTxk1sS9112OK7Jtn1PkFhBEzUnB4Y=; b=b7dWSB7FHzi7QaRxseb09AYqUEyPVmCkDruEpj5BI+/bnG8giBUanSBl3wZc8+42+E Dn40nnXID4Nx96rAG73ixszMCIyIcOg0YMHau1jYAbVB/3JeDFphDGsU6XS+xbwFi2Wc Gu2s6p1KuB8j0oDe6pAX6JYTes1xcCeA3IXwovjRwyiFbU24BpQxnAQY5mVE/pkUSrMf tqwwn/0D+oiL5wO7VBQ9cFiCyc3A4/U7aatfdXZmLGxJA0lGYtr2/2h5tZkasrcBNsE3 CalaxdGQTsDQxNmGHWzyGpvkNGwm863iHUUJPRFwLuFvPpM4ekxwmUd1AWN+5pleDxtf iRIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=euGAurZX4qBq2rTxk1sS9112OK7Jtn1PkFhBEzUnB4Y=; b=bpBhWLMqWrk48wAxKQaWmtiIpA32QyO/gQDhwjZfUiX9SswmpgXtmO5aeglAFThVGV gBO2oxFQynOMYb83oD2XIayeDhXddLN3hkn7vM5/JPHd63JH/Y+AdyNnWmk2ik1JSfI/ QedN57OkZtI9gMf5V5YONXVVxEtXdgRV2B5w4KAnmZ/zDzpbZO/sszd+ZlFIzkAbNXuS H2ywUrKZOFqcIVrvn011oRpoW57ebKO74AessOpIgEcCroBdzhhTiWEuGfz0o5V7dwMl 8tFITtF3+Xf1q4FDm/Tei8I0OK491fEBeh1fwB0L6glRJhvLHeauMIv6LuQRDFJYpku4 XD0w== X-Gm-Message-State: AOAM531L2KM29a9YOEBnc97HZW1JGbRKagDfWrsSjCoK/jPwxrIC1Ql0 OTcFey7NIsi0c4Y+Pcr0wVvW95mCVwk= X-Received: by 2002:a17:902:778f:b029:d2:839f:9198 with SMTP id o15-20020a170902778fb02900d2839f9198mr394206pll.6.1601483201385; Wed, 30 Sep 2020 09:26:41 -0700 (PDT) Received: from ubuntu-m3-large-x86 ([2604:1380:45e1:2200::1]) by smtp.gmail.com with ESMTPSA id f9sm2754947pjq.26.2020.09.30.09.26.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 09:26:40 -0700 (PDT) Date: Wed, 30 Sep 2020 09:26:38 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Andrew Morton , kbuild test robot , Kees Cook , Masahiro Yamada , Matthias Maennich , Jessica Yu , Greg Kroah-Hartman , Will Deacon , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] export.h: fix section name for CONFIG_TRIM_UNUSED_KSYMS for Clang Message-ID: <20200930162638.GB236767@ubuntu-m3-large-x86> References: <20200929190701.398762-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200929190701.398762-1-ndesaulniers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 29, 2020 at 12:07:00PM -0700, Nick Desaulniers wrote: > 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 Reviewed-by: Nathan Chancellor > --- > 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 >