linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: James Hogan <james.hogan@imgtec.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Al Viro <viro@zeniv.linux.org.uk>, Michal Marek <mmarek@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <khali@linux-fr.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mike Frysinger <vapier@gentoo.org>,
	uclinux-dist-devel@blackfin.uclinux.org,
	linux-next@vger.kernel.org
Subject: Re: [RFC -next] linux/linkage.h: fix symbol prefix handling
Date: Wed, 13 Mar 2013 19:15:38 +0100	[thread overview]
Message-ID: <20130313181538.GA20097@merkur.ravnborg.org> (raw)
In-Reply-To: <514044FD.2040502@imgtec.com>

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

  reply	other threads:[~2013-03-13 18:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 11:44 [RFC -next] linux/linkage.h: fix symbol prefix handling James Hogan
2013-03-08  0:03 ` Rusty Russell
2013-03-08  9:15   ` James Hogan
2013-03-11  6:35     ` Rusty Russell
2013-03-11 12:07       ` Stephen Rothwell
2013-03-12  4:48         ` Rusty Russell
2013-03-12 12:33           ` Stephen Rothwell
2013-03-13  0:00             ` Rusty Russell
2013-03-13  6:31               ` Sam Ravnborg
2013-03-13  9:21                 ` James Hogan
2013-03-13 18:15                   ` Sam Ravnborg [this message]
2013-03-14  4:00                 ` Rusty Russell
2013-03-14 10:49                   ` James Hogan
2013-03-15  4:37                     ` Rusty Russell
2013-03-12 12:36           ` James Hogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130313181538.GA20097@merkur.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=james.hogan@imgtec.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mmarek@suse.cz \
    --cc=rusty@rustcorp.com.au \
    --cc=sfr@canb.auug.org.au \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).