[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130313181538.GA20097@merkur.ravnborg.org>
Date: Wed, 13 Mar 2013 19:15:38 +0100
From: Sam Ravnborg <sam@...nborg.org>
To: James Hogan <james.hogan@...tec.com>
Cc: Rusty Russell <rusty@...tcorp.com.au>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Al Viro <viro@...iv.linux.org.uk>,
Michal Marek <mmarek@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Guenter Roeck <linux@...ck-us.net>,
Jean Delvare <khali@...ux-fr.org>,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Mike Frysinger <vapier@...too.org>,
uclinux-dist-devel@...ckfin.uclinux.org, linux-next@...r.kernel.org
Subject: Re: [RFC -next] linux/linkage.h: fix symbol prefix handling
On Wed, Mar 13, 2013 at 09:21:01AM +0000, James Hogan wrote:
> Hi Sam,
>
> On 13/03/13 06:31, Sam Ravnborg wrote:
> >> /* Some toolchains use a `_' prefix for all user symbols. */
> >> -#ifdef CONFIG_SYMBOL_PREFIX
> >> -#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
> >> +#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
> >> +#define __VMLINUX_SYMBOL(x) _##x
> >> +#define __VMLINUX_SYMBOL_STR(x) "_" #x
> >> +#define VMLINUX_SYMBOL_PREFIX_STR "_"
> >> #else
> >> -#define MODULE_SYMBOL_PREFIX ""
> >> +#define __VMLINUX_SYMBOL(x) x
> >> +#define __VMLINUX_SYMBOL_STR(x) #x
> >> +#define VMLINUX_SYMBOL_PREFIX_STR ""
> >> #endif
> >
> > We know the prefix is an underscore. No benefits from defining
> > VMLINUX_SYMBOL_PREFIX_STR.
>
> scripts/modpost.c uses the actual prefix string though:
>
> > if (memcmp(symname, MODULE_SYMBOL_PREFIX,
> > strlen(MODULE_SYMBOL_PREFIX)) == 0) {
> > mod->unres =
> > alloc_symbol(symname +
> > strlen(MODULE_SYMBOL_PREFIX),
> > ELF_ST_BIND(sym->st_info) == STB_WEAK,
> > mod->unres);
>
Allowing ourself to know this is "_" then we could make the above code look
something like:
if (have_symbol_prefix_underscore) {
if (symname[0] == '_') {
mod->unres =
...
But I do not feel strong about this part.
It is much more important to clean up so we use the
same definition all over the kernel.
Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists