1 #ifndef __ASM_GENERIC_EXPORT_H
2 #define __ASM_GENERIC_EXPORT_H
20 .macro __put, val, name
21 #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
22 .long \val - ., \name - .
23 #elif defined(CONFIG_64BIT)
31 * note on .section use: @progbits vs %progbits nastiness doesn't matter,
32 * since we immediately emit into those sections anyway.
34 .macro ___EXPORT_SYMBOL name,val,sec
36 .globl __ksymtab_\name
37 .section ___ksymtab\sec+\name,"a"
40 __put \val, __kstrtab_\name
42 .section __ksymtab_strings,"a"
46 #ifdef CONFIG_MODVERSIONS
47 .section ___kcrctab\sec+\name,"a"
50 #if defined(CONFIG_MODULE_REL_CRCS)
62 #if defined(CONFIG_TRIM_UNUSED_KSYMS)
64 #include <linux/kconfig.h>
65 #include <generated/autoksyms.h>
67 .macro __ksym_marker sym
68 .section ".discard.ksym","a"
73 #define __EXPORT_SYMBOL(sym, val, sec) \
75 __cond_export_sym(sym, val, sec, __is_defined(__KSYM_##sym))
76 #define __cond_export_sym(sym, val, sec, conf) \
77 ___cond_export_sym(sym, val, sec, conf)
78 #define ___cond_export_sym(sym, val, sec, enabled) \
79 __cond_export_sym_##enabled(sym, val, sec)
80 #define __cond_export_sym_1(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
81 #define __cond_export_sym_0(sym, val, sec) /* nothing */
84 #define __EXPORT_SYMBOL(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
87 #define EXPORT_SYMBOL(name) \
88 __EXPORT_SYMBOL(name, KSYM_FUNC(name),)
89 #define EXPORT_SYMBOL_GPL(name) \
90 __EXPORT_SYMBOL(name, KSYM_FUNC(name), _gpl)
91 #define EXPORT_DATA_SYMBOL(name) \
92 __EXPORT_SYMBOL(name, name,)
93 #define EXPORT_DATA_SYMBOL_GPL(name) \
94 __EXPORT_SYMBOL(name, name,_gpl)