summaryrefslogtreecommitdiff
path: root/include/linux/export.h
diff options
context:
space:
mode:
authorNick Desaulniers <ndesaulniers@google.com>2020-10-14 02:48:01 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-10-14 04:38:26 +0300
commit4d6fb34acb5d0bfc579ccd29df9cc6f653e51ab2 (patch)
tree4ec97f08c1385b2ac70502b594bd6c000858ca2b /include/linux/export.h
parenta25c13b3aa1bdbf100e8770902c30908728f8410 (diff)
downloadlinux-4d6fb34acb5d0bfc579ccd29df9cc6f653e51ab2.tar.xz
export.h: fix section name for CONFIG_TRIM_UNUSED_KSYMS for Clang
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. Fixes: commit bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS") Reported-by: kbuild test robot <lkp@intel.com> Suggested-by: Kees Cook <keescook@chromium.org> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Kees Cook <keescook@chromium.org> Cc: Nathan Chancellor <natechancellor@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Matthias Maennich <maennich@google.com> Cc: Jessica Yu <jeyu@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Will Deacon <will@kernel.org> Link: https://bugs.llvm.org/show_bug.cgi?id=42950 Link: https://github.com/ClangBuiltLinux/linux/issues/1166 Link: https://lkml.kernel.org/r/20200929190701.398762-1-ndesaulniers@google.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/export.h')
-rw-r--r--include/linux/export.h2
1 files changed, 1 insertions, 1 deletions
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); \