Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

include/linux/compiler.h: fix Oops for Clang-compiled kernels

GCC unescapes escaped string section names while Clang does not. Because
__section uses the `#` stringification operator for the section name, it
doesn't need to be escaped.

This fixes an Oops observed in distro's that use systemd and not
net.core.bpf_jit_enable=1, when their kernels are compiled with Clang.

Link: https://github.com/ClangBuiltLinux/linux/issues/619
Link: https://bugs.llvm.org/show_bug.cgi?id=42950
Link: https://marc.info/?l=linux-netdev&m=156412960619946&w=2
Link: https://lore.kernel.org/lkml/20190904181740.GA19688@gmail.com/
Acked-by: Will Deacon <will@kernel.org>
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
[Cherry-picked from the __section cleanup series for 5.3]
[Adjusted commit message]
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>

authored by

Nick Desaulniers and committed by
Miguel Ojeda
bfafddd8 089cf7f6

+4 -4
+4 -4
include/linux/compiler.h
··· 24 long ______r; \ 25 static struct ftrace_likely_data \ 26 __aligned(4) \ 27 - __section("_ftrace_annotated_branch") \ 28 ______f = { \ 29 .data.func = __func__, \ 30 .data.file = __FILE__, \ ··· 60 #define __trace_if_value(cond) ({ \ 61 static struct ftrace_branch_data \ 62 __aligned(4) \ 63 - __section("_ftrace_branch") \ 64 __if_trace = { \ 65 .func = __func__, \ 66 .file = __FILE__, \ ··· 118 ".popsection\n\t" 119 120 /* Annotate a C jump table to allow objtool to follow the code flow */ 121 - #define __annotate_jump_table __section(".rodata..c_jump_table") 122 123 #else 124 #define annotate_reachable() ··· 298 * visible to the compiler. 299 */ 300 #define __ADDRESSABLE(sym) \ 301 - static void * __section(".discard.addressable") __used \ 302 __PASTE(__addressable_##sym, __LINE__) = (void *)&sym; 303 304 /**
··· 24 long ______r; \ 25 static struct ftrace_likely_data \ 26 __aligned(4) \ 27 + __section(_ftrace_annotated_branch) \ 28 ______f = { \ 29 .data.func = __func__, \ 30 .data.file = __FILE__, \ ··· 60 #define __trace_if_value(cond) ({ \ 61 static struct ftrace_branch_data \ 62 __aligned(4) \ 63 + __section(_ftrace_branch) \ 64 __if_trace = { \ 65 .func = __func__, \ 66 .file = __FILE__, \ ··· 118 ".popsection\n\t" 119 120 /* Annotate a C jump table to allow objtool to follow the code flow */ 121 + #define __annotate_jump_table __section(.rodata..c_jump_table) 122 123 #else 124 #define annotate_reachable() ··· 298 * visible to the compiler. 299 */ 300 #define __ADDRESSABLE(sym) \ 301 + static void * __section(.discard.addressable) __used \ 302 __PASTE(__addressable_##sym, __LINE__) = (void *)&sym; 303 304 /**