linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] srcu: avoid escaped section names
@ 2020-09-29 19:22 Nick Desaulniers
  2020-09-29 19:22 ` Nick Desaulniers
  0 siblings, 1 reply; 30+ messages in thread
From: Nick Desaulniers @ 2020-09-29 19:22 UTC (permalink / raw)
  To: Paul E . McKenney
  Cc: Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan, Josh Triplett,
	Kees Cook, linux-kernel, rcu, clang-built-linux,
	Nick Desaulniers

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.

Link: https://bugs.llvm.org/show_bug.cgi?id=42950
Fixes: commit fe15b50cdeee ("srcu: Allocate per-CPU data for DEFINE_SRCU() in modules")
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 arch/arm/Kconfig         |  1 +
 arch/arm/mm/Kconfig      | 11 +++++++++++
 include/linux/srcutree.h |  2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index fe2f17eb2b50..51200e371faf 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -358,6 +358,7 @@ config ARCH_EBSA110
 
 config ARCH_EP93XX
 	bool "EP93xx-based"
+	depends on !LD_IS_LLD
 	select ARCH_SPARSEMEM_ENABLE
 	select ARM_AMBA
 	imply ARM_PATCH_PHYS_VIRT
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 65e4482e3849..c06787c9bb48 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -9,6 +9,7 @@ comment "Processor Type"
 config CPU_ARM7TDMI
 	bool
 	depends on !MMU
+	depends on !LD_IS_LLD
 	select CPU_32v4T
 	select CPU_ABRT_LV4T
 	select CPU_CACHE_V4
@@ -23,6 +24,7 @@ config CPU_ARM7TDMI
 # ARM720T
 config CPU_ARM720T
 	bool
+	depends on !LD_IS_LLD
 	select CPU_32v4T
 	select CPU_ABRT_LV4T
 	select CPU_CACHE_V4
@@ -43,6 +45,7 @@ config CPU_ARM720T
 config CPU_ARM740T
 	bool
 	depends on !MMU
+	depends on !LD_IS_LLD
 	select CPU_32v4T
 	select CPU_ABRT_LV4T
 	select CPU_CACHE_V4
@@ -61,6 +64,7 @@ config CPU_ARM740T
 config CPU_ARM9TDMI
 	bool
 	depends on !MMU
+	depends on !LD_IS_LLD
 	select CPU_32v4T
 	select CPU_ABRT_NOMMU
 	select CPU_CACHE_V4
@@ -75,6 +79,7 @@ config CPU_ARM9TDMI
 # ARM920T
 config CPU_ARM920T
 	bool
+	depends on !LD_IS_LLD
 	select CPU_32v4T
 	select CPU_ABRT_EV4T
 	select CPU_CACHE_V4WT
@@ -94,6 +99,7 @@ config CPU_ARM920T
 # ARM922T
 config CPU_ARM922T
 	bool
+	depends on !LD_IS_LLD
 	select CPU_32v4T
 	select CPU_ABRT_EV4T
 	select CPU_CACHE_V4WT
@@ -114,6 +120,7 @@ config CPU_ARM922T
 # ARM925T
 config CPU_ARM925T
 	bool
+	depends on !LD_IS_LLD
 	select CPU_32v4T
 	select CPU_ABRT_EV4T
 	select CPU_CACHE_V4WT
@@ -153,6 +160,7 @@ config CPU_ARM926T
 # FA526
 config CPU_FA526
 	bool
+	depends on !LD_IS_LLD
 	select CPU_32v4
 	select CPU_ABRT_EV4
 	select CPU_CACHE_FA
@@ -172,6 +180,7 @@ config CPU_FA526
 config CPU_ARM940T
 	bool
 	depends on !MMU
+	depends on !LD_IS_LLD
 	select CPU_32v4T
 	select CPU_ABRT_NOMMU
 	select CPU_CACHE_VIVT
@@ -278,6 +287,7 @@ config CPU_ARM1026
 # SA110
 config CPU_SA110
 	bool
+	depends on !LD_IS_LLD
 	select CPU_32v3 if ARCH_RPC
 	select CPU_32v4 if !ARCH_RPC
 	select CPU_ABRT_EV4
@@ -299,6 +309,7 @@ config CPU_SA110
 # SA1100
 config CPU_SA1100
 	bool
+	depends on !LD_IS_LLD
 	select CPU_32v4
 	select CPU_ABRT_EV4
 	select CPU_CACHE_V4WB
diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h
index 9cfcc8a756ae..9de652f4e1bd 100644
--- a/include/linux/srcutree.h
+++ b/include/linux/srcutree.h
@@ -124,7 +124,7 @@ struct srcu_struct {
 # define __DEFINE_SRCU(name, is_static)					\
 	is_static struct srcu_struct name;				\
 	struct srcu_struct * const __srcu_struct_##name			\
-		__section("___srcu_struct_ptrs") = &name
+		__section(___srcu_struct_ptrs) = &name
 #else
 # define __DEFINE_SRCU(name, is_static)					\
 	static DEFINE_PER_CPU(struct srcu_data, name##_srcu_data);	\
-- 
2.28.0.709.gb0816b6eb0-goog


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2020-10-07 21:05 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 19:22 [PATCH] srcu: avoid escaped section names Nick Desaulniers
2020-09-29 19:22 ` Nick Desaulniers
2020-09-29 19:25   ` [PATCH v2] " Nick Desaulniers
2020-09-29 23:45     ` Kees Cook
2020-09-30 16:27     ` Nathan Chancellor
2020-09-30 16:41     ` Sedat Dilek
2020-09-30 18:57       ` Joe Perches
2020-09-30 19:16         ` [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo") Joe Perches
2020-09-30 21:40           ` Nick Desaulniers
2020-09-30 22:06             ` Joe Perches
2020-09-30 22:12               ` Joe Perches
2020-09-30 22:20               ` Nick Desaulniers
2020-09-30 22:25                 ` Joe Perches
2020-09-30 22:56                   ` Joe Perches
2020-10-01 10:15                     ` Miguel Ojeda
2020-10-01 19:05                       ` Joe Perches
2020-10-01 19:39                       ` Segher Boessenkool
2020-10-01 20:19                         ` Joe Perches
2020-10-05 18:36                           ` Nick Desaulniers
2020-10-05 18:46                             ` Joe Perches
2020-10-06  0:34                           ` Joel Stanley
2020-10-06  3:22                             ` Joe Perches
2020-09-30 20:40     ` [PATCH v2] srcu: avoid escaped section names Paul E. McKenney
2020-09-30 20:55       ` Nick Desaulniers
2020-10-02 20:51         ` Paul E. McKenney
2020-10-05 18:29           ` Nick Desaulniers
2020-10-05 18:38             ` Sedat Dilek
2020-10-05 18:49               ` Paul E. McKenney
2020-10-06  6:56                 ` Nathan Chancellor
2020-10-07 21:05                   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).