Skip to content

Commit 94e58e0

Browse files
committed
export.h: remove code for prefixing symbols with underscore
CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX was selected by BLACKFIN, METAG. They were removed by commit 4ba66a9 ("arch: remove blackfin port"), commit bb6fb6d ("metag: Remove arch/metag/"), respectively. No more architecture enables CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX. Clean up the export.h headers. I am keeping VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() because they are widely used. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
1 parent 5a144a1 commit 94e58e0

2 files changed

Lines changed: 17 additions & 33 deletions

File tree

‎include/asm-generic/export.h‎

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,32 @@
1919
#define KCRC_ALIGN 4
2020
#endif
2121

22-
#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
23-
#define KSYM(name) _##name
24-
#else
25-
#define KSYM(name) name
26-
#endif
27-
2822
/*
2923
* note on .section use: @progbits vs %progbits nastiness doesn't matter,
3024
* since we immediately emit into those sections anyway.
3125
*/
3226
.macro ___EXPORT_SYMBOL name,val,sec
3327
#ifdef CONFIG_MODULES
34-
.globl KSYM(__ksymtab_\name)
28+
.globl __ksymtab_\name
3529
.section ___ksymtab\sec+\name,"a"
3630
.balign KSYM_ALIGN
37-
KSYM(__ksymtab_\name):
38-
__put \val, KSYM(__kstrtab_\name)
31+
__ksymtab_\name:
32+
__put \val, __kstrtab_\name
3933
.previous
4034
.section __ksymtab_strings,"a"
41-
KSYM(__kstrtab_\name):
42-
#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
43-
.asciz "_\name"
44-
#else
35+
__kstrtab_\name:
4536
.asciz "\name"
46-
#endif
4737
.previous
4838
#ifdef CONFIG_MODVERSIONS
4939
.section ___kcrctab\sec+\name,"a"
5040
.balign KCRC_ALIGN
51-
KSYM(__kcrctab_\name):
41+
__kcrctab_\name:
5242
#if defined(CONFIG_MODULE_REL_CRCS)
53-
.long KSYM(__crc_\name) - .
43+
.long __crc_\name - .
5444
#else
55-
.long KSYM(__crc_\name)
45+
.long __crc_\name
5646
#endif
57-
.weak KSYM(__crc_\name)
47+
.weak __crc_\name
5848
.previous
5949
#endif
6050
#endif
@@ -84,12 +74,12 @@ KSYM(__kcrctab_\name):
8474
#endif
8575

8676
#define EXPORT_SYMBOL(name) \
87-
__EXPORT_SYMBOL(name, KSYM_FUNC(KSYM(name)),)
77+
__EXPORT_SYMBOL(name, KSYM_FUNC(name),)
8878
#define EXPORT_SYMBOL_GPL(name) \
89-
__EXPORT_SYMBOL(name, KSYM_FUNC(KSYM(name)), _gpl)
79+
__EXPORT_SYMBOL(name, KSYM_FUNC(name), _gpl)
9080
#define EXPORT_DATA_SYMBOL(name) \
91-
__EXPORT_SYMBOL(name, KSYM(name),)
81+
__EXPORT_SYMBOL(name, name,)
9282
#define EXPORT_DATA_SYMBOL_GPL(name) \
93-
__EXPORT_SYMBOL(name, KSYM(name),_gpl)
83+
__EXPORT_SYMBOL(name, name,_gpl)
9484

9585
#endif

‎include/linux/export.h‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@
1010
* hackers place grumpy comments in header files.
1111
*/
1212

13-
/* Some toolchains use a `_' prefix for all user symbols. */
14-
#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
15-
#define __VMLINUX_SYMBOL(x) _##x
16-
#define __VMLINUX_SYMBOL_STR(x) "_" #x
17-
#else
1813
#define __VMLINUX_SYMBOL(x) x
1914
#define __VMLINUX_SYMBOL_STR(x) #x
20-
#endif
2115

2216
/* Indirect, so macros are expanded before pasting. */
2317
#define VMLINUX_SYMBOL(x) __VMLINUX_SYMBOL(x)
@@ -46,14 +40,14 @@ extern struct module __this_module;
4640
#if defined(CONFIG_MODULE_REL_CRCS)
4741
#define __CRC_SYMBOL(sym, sec) \
4842
asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \
49-
" .weak " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \
50-
" .long " VMLINUX_SYMBOL_STR(__crc_##sym) " - . \n" \
43+
" .weak __crc_" #sym " \n" \
44+
" .long __crc_" #sym " - . \n" \
5145
" .previous \n");
5246
#else
5347
#define __CRC_SYMBOL(sym, sec) \
5448
asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \
55-
" .weak " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \
56-
" .long " VMLINUX_SYMBOL_STR(__crc_##sym) " \n" \
49+
" .weak __crc_" #sym " \n" \
50+
" .long __crc_" #sym " \n" \
5751
" .previous \n");
5852
#endif
5953
#else
@@ -66,7 +60,7 @@ extern struct module __this_module;
6660
__CRC_SYMBOL(sym, sec) \
6761
static const char __kstrtab_##sym[] \
6862
__attribute__((section("__ksymtab_strings"), aligned(1))) \
69-
= VMLINUX_SYMBOL_STR(sym); \
63+
= #sym; \
7064
static const struct kernel_symbol __ksymtab_##sym \
7165
__used \
7266
__attribute__((section("___ksymtab" sec "+" #sym), used)) \

0 commit comments

Comments
 (0)