History

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.

Nick Desaulniers committed 7 years ago

Commit bfafddd1 parent 089cf7f1 file · +4 −4Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/compiler.h+4−4
@@ -24,7 +24,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 23 unmodified lines
2424 long ______r; \
2525 static struct ftrace_likely_data \
2626 __aligned(4) \
27− __section("_ftrace_annotated_branch") \
27+ __section(_ftrace_annotated_branch) \
2828 ______f = { \
2929 .data.func = __func__, \
3030 .data.file = __FILE__, \
@@ -60,7 +60,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 29 unmodified lines
6060 #define __trace_if_value(cond) ({ \
6161 static struct ftrace_branch_data \
6262 __aligned(4) \
63− __section("_ftrace_branch") \
63+ __section(_ftrace_branch) \
6464 __if_trace = { \
6565 .func = __func__, \
6666 .file = __FILE__, \
@@ -118,7 +118,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 51 unmodified lines
118118 ".popsection\n\t"
119119
120120 /* Annotate a C jump table to allow objtool to follow the code flow */
121−#define __annotate_jump_table __section(".rodata..c_jump_table")
121+#define __annotate_jump_table __section(.rodata..c_jump_table)
122122
123123 #else
124124 #define annotate_reachable()
@@ -298,7 +298,7 @@ unsigned long read_word_at_a_time(const void *addr) · 173 unmodified lines
298298 * visible to the compiler.
299299 */
300300 #define __ADDRESSABLE(sym) \
301− static void * __section(".discard.addressable") __used \
301+ static void * __section(.discard.addressable) __used \
302302 __PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
303303
304304 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t