aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/export.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/export.h')
-rw-r--r--include/linux/export.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/export.h b/include/linux/export.h
index d7df4922da1d..2a0f61fbc731 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -1,5 +1,6 @@
1#ifndef _LINUX_EXPORT_H 1#ifndef _LINUX_EXPORT_H
2#define _LINUX_EXPORT_H 2#define _LINUX_EXPORT_H
3
3/* 4/*
4 * Export symbols from the kernel to modules. Forked from module.h 5 * Export symbols from the kernel to modules. Forked from module.h
5 * to reduce the amount of pointless cruft we feed to gcc when only 6 * to reduce the amount of pointless cruft we feed to gcc when only
@@ -42,27 +43,26 @@ extern struct module __this_module;
42#ifdef CONFIG_MODVERSIONS 43#ifdef CONFIG_MODVERSIONS
43/* Mark the CRC weak since genksyms apparently decides not to 44/* Mark the CRC weak since genksyms apparently decides not to
44 * generate a checksums for some symbols */ 45 * generate a checksums for some symbols */
45#define __CRC_SYMBOL(sym, sec) \ 46#define __CRC_SYMBOL(sym, sec) \
46 extern __visible void *__crc_##sym __attribute__((weak)); \ 47 extern __visible void *__crc_##sym __attribute__((weak)); \
47 static const unsigned long __kcrctab_##sym \ 48 static const unsigned long __kcrctab_##sym \
48 __used \ 49 __used \
49 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \ 50 __attribute__((section("___kcrctab" sec "+" #sym), used)) \
50 = (unsigned long) &__crc_##sym; 51 = (unsigned long) &__crc_##sym;
51#else 52#else
52#define __CRC_SYMBOL(sym, sec) 53#define __CRC_SYMBOL(sym, sec)
53#endif 54#endif
54 55
55/* For every exported symbol, place a struct in the __ksymtab section */ 56/* For every exported symbol, place a struct in the __ksymtab section */
56#define ___EXPORT_SYMBOL(sym, sec) \ 57#define ___EXPORT_SYMBOL(sym, sec) \
57 extern typeof(sym) sym; \ 58 extern typeof(sym) sym; \
58 __CRC_SYMBOL(sym, sec) \ 59 __CRC_SYMBOL(sym, sec) \
59 static const char __kstrtab_##sym[] \ 60 static const char __kstrtab_##sym[] \
60 __attribute__((section("__ksymtab_strings"), aligned(1))) \ 61 __attribute__((section("__ksymtab_strings"), aligned(1))) \
61 = VMLINUX_SYMBOL_STR(sym); \ 62 = VMLINUX_SYMBOL_STR(sym); \
62 extern const struct kernel_symbol __ksymtab_##sym; \ 63 static const struct kernel_symbol __ksymtab_##sym \
63 __visible const struct kernel_symbol __ksymtab_##sym \ 64 __used \
64 __used \ 65 __attribute__((section("___ksymtab" sec "+" #sym), used)) \
65 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
66 = { (unsigned long)&sym, __kstrtab_##sym } 66 = { (unsigned long)&sym, __kstrtab_##sym }
67 67
68#if defined(__KSYM_DEPS__) 68#if defined(__KSYM_DEPS__)