diff options
author | Andi Kleen <ak@linux.intel.com> | 2013-10-22 20:27:58 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-10-28 19:13:37 -0400 |
commit | e0f244c63fc9d192dfd399cc2677bbdca61994b1 (patch) | |
tree | 0196f9eab616fdb4a6289050e7c96bd1c944a70e | |
parent | eb3057df732c304622aee77c450761746939a2dc (diff) |
asmlinkage, module: Make ksymtab and kcrctab symbols and __this_module __visible
Make the ksymtab symbols for EXPORT_SYMBOL visible.
This prevents the LTO compiler from adding a .NUMBER prefix,
which avoids various problems in later export processing.
Cc: rusty@rustcorp.com.au
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | include/linux/export.h | 4 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/export.h b/include/linux/export.h index 412cd509effe..3f2793d51899 100644 --- a/include/linux/export.h +++ b/include/linux/export.h | |||
@@ -43,7 +43,7 @@ extern struct module __this_module; | |||
43 | /* Mark the CRC weak since genksyms apparently decides not to | 43 | /* Mark the CRC weak since genksyms apparently decides not to |
44 | * generate a checksums for some symbols */ | 44 | * generate a checksums for some symbols */ |
45 | #define __CRC_SYMBOL(sym, sec) \ | 45 | #define __CRC_SYMBOL(sym, sec) \ |
46 | extern void *__crc_##sym __attribute__((weak)); \ | 46 | extern __visible void *__crc_##sym __attribute__((weak)); \ |
47 | static const unsigned long __kcrctab_##sym \ | 47 | static const unsigned long __kcrctab_##sym \ |
48 | __used \ | 48 | __used \ |
49 | __attribute__((section("___kcrctab" sec "+" #sym), unused)) \ | 49 | __attribute__((section("___kcrctab" sec "+" #sym), unused)) \ |
@@ -59,7 +59,7 @@ extern struct module __this_module; | |||
59 | static const char __kstrtab_##sym[] \ | 59 | static const char __kstrtab_##sym[] \ |
60 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ | 60 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ |
61 | = VMLINUX_SYMBOL_STR(sym); \ | 61 | = VMLINUX_SYMBOL_STR(sym); \ |
62 | static const struct kernel_symbol __ksymtab_##sym \ | 62 | __visible const struct kernel_symbol __ksymtab_##sym \ |
63 | __used \ | 63 | __used \ |
64 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ | 64 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ |
65 | = { (unsigned long)&sym, __kstrtab_##sym } | 65 | = { (unsigned long)&sym, __kstrtab_##sym } |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 393706b37774..9b873ac6ed7b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -1861,7 +1861,7 @@ static void add_header(struct buffer *b, struct module *mod) | |||
1861 | buf_printf(b, "\n"); | 1861 | buf_printf(b, "\n"); |
1862 | buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); | 1862 | buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); |
1863 | buf_printf(b, "\n"); | 1863 | buf_printf(b, "\n"); |
1864 | buf_printf(b, "struct module __this_module\n"); | 1864 | buf_printf(b, "__visible struct module __this_module\n"); |
1865 | buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); | 1865 | buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); |
1866 | buf_printf(b, "\t.name = KBUILD_MODNAME,\n"); | 1866 | buf_printf(b, "\t.name = KBUILD_MODNAME,\n"); |
1867 | if (mod->has_init) | 1867 | if (mod->has_init) |