diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-03-15 00:34:17 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-03-15 00:39:43 -0400 |
commit | b92021b09df70c1609e3547f3d6128dd560be97f (patch) | |
tree | 0203752a738c71718f5141b84f5143d1dc8b431d /kernel/modsign_certificate.S | |
parent | 4febd95a8a85dd38b1a71fcf9726e19c7fd20039 (diff) |
CONFIG_SYMBOL_PREFIX: cleanup.
We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
"_". But Al Viro broke this in "consolidate cond_syscall and
SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
do so.
Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
prefix it so something. So various places define helpers which are
defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:
1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
for pasting.
(arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).
Let's solve this properly:
1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
2) Make linux/export.h usable from asm.
3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
4) Make everyone use them.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Tested-by: James Hogan <james.hogan@imgtec.com> (metag)
Diffstat (limited to 'kernel/modsign_certificate.S')
-rw-r--r-- | kernel/modsign_certificate.S | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/kernel/modsign_certificate.S b/kernel/modsign_certificate.S index 246b4c6e6135..4a9a86d12c8b 100644 --- a/kernel/modsign_certificate.S +++ b/kernel/modsign_certificate.S | |||
@@ -1,15 +1,8 @@ | |||
1 | /* SYMBOL_PREFIX defined on commandline from CONFIG_SYMBOL_PREFIX */ | 1 | #include <linux/export.h> |
2 | #ifndef SYMBOL_PREFIX | ||
3 | #define ASM_SYMBOL(sym) sym | ||
4 | #else | ||
5 | #define PASTE2(x,y) x##y | ||
6 | #define PASTE(x,y) PASTE2(x,y) | ||
7 | #define ASM_SYMBOL(sym) PASTE(SYMBOL_PREFIX, sym) | ||
8 | #endif | ||
9 | 2 | ||
10 | #define GLOBAL(name) \ | 3 | #define GLOBAL(name) \ |
11 | .globl ASM_SYMBOL(name); \ | 4 | .globl VMLINUX_SYMBOL(name); \ |
12 | ASM_SYMBOL(name): | 5 | VMLINUX_SYMBOL(name): |
13 | 6 | ||
14 | .section ".init.data","aw" | 7 | .section ".init.data","aw" |
15 | 8 | ||