diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-05 13:58:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-05 13:58:06 -0400 |
| commit | f8ce1faf55955de62e0a12e330c6d9a526071f65 (patch) | |
| tree | a3b0ddd3f37e40d3ed0fd2cd433a2723403c8b97 /include/linux | |
| parent | 24d0c2542b38963ae4d5171ecc0a2c1326c656bc (diff) | |
| parent | a53a11f35762ff1d5e268adedf2ab9ce313f871d (diff) | |
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull mudule updates from Rusty Russell:
"We get rid of the general module prefix confusion with a binary config
option, fix a remove/insert race which Never Happens, and (my
favorite) handle the case when we have too many modules for a single
commandline. Seriously, the kernel is full, please go away!"
* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
modpost: fix unwanted VMLINUX_SYMBOL_STR expansion
X.509: Support parse long form of length octets in Authority Key Identifier
module: don't unlink the module until we've removed all exposure.
kernel: kallsyms: memory override issue, need check destination buffer length
MODSIGN: do not send garbage to stderr when enabling modules signature
modpost: handle huge numbers of modules.
modpost: add -T option to read module names from file/stdin.
modpost: minor cleanup.
genksyms: pass symbol-prefix instead of arch
module: fix symbol versioning with symbol prefixes
CONFIG_SYMBOL_PREFIX: cleanup.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/export.h | 20 | ||||
| -rw-r--r-- | include/linux/kernel.h | 7 | ||||
| -rw-r--r-- | include/linux/linkage.h | 20 | ||||
| -rw-r--r-- | include/linux/module.h | 4 |
4 files changed, 25 insertions, 26 deletions
diff --git a/include/linux/export.h b/include/linux/export.h index 696c0f48afc7..412cd509effe 100644 --- a/include/linux/export.h +++ b/include/linux/export.h | |||
| @@ -5,17 +5,24 @@ | |||
| 5 | * to reduce the amount of pointless cruft we feed to gcc when only | 5 | * to reduce the amount of pointless cruft we feed to gcc when only |
| 6 | * exporting a simple symbol or two. | 6 | * exporting a simple symbol or two. |
| 7 | * | 7 | * |
| 8 | * If you feel the need to add #include <linux/foo.h> to this file | 8 | * Try not to add #includes here. It slows compilation and makes kernel |
| 9 | * then you are doing something wrong and should go away silently. | 9 | * hackers place grumpy comments in header files. |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | /* Some toolchains use a `_' prefix for all user symbols. */ | 12 | /* Some toolchains use a `_' prefix for all user symbols. */ |
| 13 | #ifdef CONFIG_SYMBOL_PREFIX | 13 | #ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX |
| 14 | #define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX | 14 | #define __VMLINUX_SYMBOL(x) _##x |
| 15 | #define __VMLINUX_SYMBOL_STR(x) "_" #x | ||
| 15 | #else | 16 | #else |
| 16 | #define MODULE_SYMBOL_PREFIX "" | 17 | #define __VMLINUX_SYMBOL(x) x |
| 18 | #define __VMLINUX_SYMBOL_STR(x) #x | ||
| 17 | #endif | 19 | #endif |
| 18 | 20 | ||
| 21 | /* Indirect, so macros are expanded before pasting. */ | ||
| 22 | #define VMLINUX_SYMBOL(x) __VMLINUX_SYMBOL(x) | ||
| 23 | #define VMLINUX_SYMBOL_STR(x) __VMLINUX_SYMBOL_STR(x) | ||
| 24 | |||
| 25 | #ifndef __ASSEMBLY__ | ||
| 19 | struct kernel_symbol | 26 | struct kernel_symbol |
| 20 | { | 27 | { |
| 21 | unsigned long value; | 28 | unsigned long value; |
| @@ -51,7 +58,7 @@ extern struct module __this_module; | |||
| 51 | __CRC_SYMBOL(sym, sec) \ | 58 | __CRC_SYMBOL(sym, sec) \ |
| 52 | static const char __kstrtab_##sym[] \ | 59 | static const char __kstrtab_##sym[] \ |
| 53 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ | 60 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ |
| 54 | = MODULE_SYMBOL_PREFIX #sym; \ | 61 | = VMLINUX_SYMBOL_STR(sym); \ |
| 55 | static const struct kernel_symbol __ksymtab_##sym \ | 62 | static const struct kernel_symbol __ksymtab_##sym \ |
| 56 | __used \ | 63 | __used \ |
| 57 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ | 64 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ |
| @@ -85,5 +92,6 @@ extern struct module __this_module; | |||
| 85 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | 92 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) |
| 86 | 93 | ||
| 87 | #endif /* CONFIG_MODULES */ | 94 | #endif /* CONFIG_MODULES */ |
| 95 | #endif /* !__ASSEMBLY__ */ | ||
| 88 | 96 | ||
| 89 | #endif /* _LINUX_EXPORT_H */ | 97 | #endif /* _LINUX_EXPORT_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 6d1844f393c0..e96329ceb28c 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -786,13 +786,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } | |||
| 786 | /* Trap pasters of __FUNCTION__ at compile-time */ | 786 | /* Trap pasters of __FUNCTION__ at compile-time */ |
| 787 | #define __FUNCTION__ (__func__) | 787 | #define __FUNCTION__ (__func__) |
| 788 | 788 | ||
| 789 | /* This helps us to avoid #ifdef CONFIG_SYMBOL_PREFIX */ | ||
| 790 | #ifdef CONFIG_SYMBOL_PREFIX | ||
| 791 | #define SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX | ||
| 792 | #else | ||
| 793 | #define SYMBOL_PREFIX "" | ||
| 794 | #endif | ||
| 795 | |||
| 796 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ | 789 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ |
| 797 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 790 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
| 798 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD | 791 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index de09dec25ec3..d3e8ad23a8e0 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
| 5 | #include <linux/stringify.h> | 5 | #include <linux/stringify.h> |
| 6 | #include <linux/export.h> | ||
| 6 | #include <asm/linkage.h> | 7 | #include <asm/linkage.h> |
| 7 | 8 | ||
| 8 | #ifdef __cplusplus | 9 | #ifdef __cplusplus |
| @@ -15,21 +16,18 @@ | |||
| 15 | #define asmlinkage CPP_ASMLINKAGE | 16 | #define asmlinkage CPP_ASMLINKAGE |
| 16 | #endif | 17 | #endif |
| 17 | 18 | ||
| 18 | #ifdef CONFIG_SYMBOL_PREFIX | ||
| 19 | #define __SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX __stringify(x) | ||
| 20 | #else | ||
| 21 | #define __SYMBOL_NAME(x) __stringify(x) | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #ifndef cond_syscall | 19 | #ifndef cond_syscall |
| 25 | #define cond_syscall(x) asm(".weak\t" __SYMBOL_NAME(x) \ | 20 | #define cond_syscall(x) asm( \ |
| 26 | "\n\t.set\t" __SYMBOL_NAME(x) "," __SYMBOL_NAME(sys_ni_syscall)); | 21 | ".weak " VMLINUX_SYMBOL_STR(x) "\n\t" \ |
| 22 | ".set " VMLINUX_SYMBOL_STR(x) "," \ | ||
| 23 | VMLINUX_SYMBOL_STR(sys_ni_syscall)) | ||
| 27 | #endif | 24 | #endif |
| 28 | 25 | ||
| 29 | #ifndef SYSCALL_ALIAS | 26 | #ifndef SYSCALL_ALIAS |
| 30 | #define SYSCALL_ALIAS(alias, name) \ | 27 | #define SYSCALL_ALIAS(alias, name) asm( \ |
| 31 | asm ("\t.globl " __SYMBOL_NAME(alias) \ | 28 | ".globl " VMLINUX_SYMBOL_STR(alias) "\n\t" \ |
| 32 | "\n\t.set\t" __SYMBOL_NAME(alias) "," __SYMBOL_NAME(name)) | 29 | ".set " VMLINUX_SYMBOL_STR(alias) "," \ |
| 30 | VMLINUX_SYMBOL_STR(name)) | ||
| 33 | #endif | 31 | #endif |
| 34 | 32 | ||
| 35 | #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) | 33 | #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) |
diff --git a/include/linux/module.h b/include/linux/module.h index ead1b5719a12..46f1ea01e6f6 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -190,7 +190,7 @@ extern int modules_disabled; /* for sysctl */ | |||
| 190 | /* Get/put a kernel symbol (calls must be symmetric) */ | 190 | /* Get/put a kernel symbol (calls must be symmetric) */ |
| 191 | void *__symbol_get(const char *symbol); | 191 | void *__symbol_get(const char *symbol); |
| 192 | void *__symbol_get_gpl(const char *symbol); | 192 | void *__symbol_get_gpl(const char *symbol); |
| 193 | #define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x))) | 193 | #define symbol_get(x) ((typeof(&x))(__symbol_get(VMLINUX_SYMBOL_STR(x)))) |
| 194 | 194 | ||
| 195 | /* modules using other modules: kdb wants to see this. */ | 195 | /* modules using other modules: kdb wants to see this. */ |
| 196 | struct module_use { | 196 | struct module_use { |
| @@ -453,7 +453,7 @@ extern void __module_put_and_exit(struct module *mod, long code) | |||
| 453 | #ifdef CONFIG_MODULE_UNLOAD | 453 | #ifdef CONFIG_MODULE_UNLOAD |
| 454 | unsigned long module_refcount(struct module *mod); | 454 | unsigned long module_refcount(struct module *mod); |
| 455 | void __symbol_put(const char *symbol); | 455 | void __symbol_put(const char *symbol); |
| 456 | #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) | 456 | #define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x)) |
| 457 | void symbol_put_addr(void *addr); | 457 | void symbol_put_addr(void *addr); |
| 458 | 458 | ||
| 459 | /* Sometimes we know we already have a refcount, and it's easier not | 459 | /* Sometimes we know we already have a refcount, and it's easier not |
