Re: [PATCH 04/10] module: make MODULE_SYMBOL_PREFIX into a CONFIG option

From: Mike Frysinger
Date: Tue Nov 03 2009 - 05:19:46 EST

On Tue, Nov 3, 2009 at 05:06, Alan Jenkins wrote:
> The next commit will require the use of MODULE_SYMBOL_PREFIX in
> .tmp_exports-asm.S. ÂCurrently it is mixed in with C structure
> definitions in "asm/module.h". ÂMove the definition of this arch option
> into Kconfig, so it can be easily accessed by any code.
> This also lets modpost.c use the same definition. ÂPreviously modpost
> relied on a hardcoded list of architectures in mk_elfconfig.c.

this should also let us push VMLINUX_SYMBOL() out of
arch/*/kernel/ and into asm-generic/ ...

> A build test for blackfin, one of the two MODULE_SYMBOL_PREFIX archs,
> showed the generated code was unchanged. Âvmlinux was identical save
> for build ids, and an apparently randomized suffix on a single "__key"
> symbol in the kallsyms data).

when you get localized (static) namespace collisions, the linker
automatically does that

> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1171,6 +1171,17 @@ config MODULE_SRCVERSION_ALL
> Âendif # MODULES
> + Â Â Â bool
> + Â Â Â help
> + Â Â Â Â Some arch toolchains use a `_' prefix for all user symbols.
> + Â Â Â Â This option will be taken into account when loading modules.
> +
> + Â Â Â string
> + Â Â Â default "_" if HAVE_SYMBOL_PREFIX
> + Â Â Â default ""

in practice, the symbol prefix is an underscore. but there is no
technical limitation here -- the toolchain could use whatever prefix
they wanted

so if the Kconfig option was pushed to arch/*/Kconfig, we could drop
HAVE_SYMBOL_PREFIX and let the arch declare the exact SYMBOL_PREFIX
value itself
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at