提交 e0f244c6 编写于 作者: A Andi Kleen 提交者: Rusty Russell

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: NAndi Kleen <ak@linux.intel.com>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 eb3057df
...@@ -43,7 +43,7 @@ extern struct module __this_module; ...@@ -43,7 +43,7 @@ extern struct module __this_module;
/* Mark the CRC weak since genksyms apparently decides not to /* Mark the CRC weak since genksyms apparently decides not to
* generate a checksums for some symbols */ * generate a checksums for some symbols */
#define __CRC_SYMBOL(sym, sec) \ #define __CRC_SYMBOL(sym, sec) \
extern void *__crc_##sym __attribute__((weak)); \ extern __visible void *__crc_##sym __attribute__((weak)); \
static const unsigned long __kcrctab_##sym \ static const unsigned long __kcrctab_##sym \
__used \ __used \
__attribute__((section("___kcrctab" sec "+" #sym), unused)) \ __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
...@@ -59,7 +59,7 @@ extern struct module __this_module; ...@@ -59,7 +59,7 @@ extern struct module __this_module;
static const char __kstrtab_##sym[] \ static const char __kstrtab_##sym[] \
__attribute__((section("__ksymtab_strings"), aligned(1))) \ __attribute__((section("__ksymtab_strings"), aligned(1))) \
= VMLINUX_SYMBOL_STR(sym); \ = VMLINUX_SYMBOL_STR(sym); \
static const struct kernel_symbol __ksymtab_##sym \ __visible const struct kernel_symbol __ksymtab_##sym \
__used \ __used \
__attribute__((section("___ksymtab" sec "+" #sym), unused)) \ __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
= { (unsigned long)&sym, __kstrtab_##sym } = { (unsigned long)&sym, __kstrtab_##sym }
......
...@@ -1861,7 +1861,7 @@ static void add_header(struct buffer *b, struct module *mod) ...@@ -1861,7 +1861,7 @@ static void add_header(struct buffer *b, struct module *mod)
buf_printf(b, "\n"); buf_printf(b, "\n");
buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n");
buf_printf(b, "\n"); buf_printf(b, "\n");
buf_printf(b, "struct module __this_module\n"); buf_printf(b, "__visible struct module __this_module\n");
buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
buf_printf(b, "\t.name = KBUILD_MODNAME,\n"); buf_printf(b, "\t.name = KBUILD_MODNAME,\n");
if (mod->has_init) if (mod->has_init)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册