public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Amerigo Wang <xiyou.wangcong@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Helge Deller <deller@gmx.de>
Subject: Re: modules: Fix build error in the !CONFIG_KALLSYMS case
Date: Fri, 28 Aug 2009 17:24:26 +0800	[thread overview]
Message-ID: <20090828092426.GC4849@cr0.nay.redhat.com> (raw)
In-Reply-To: <20090828084456.GB3454@elte.hu>

On Fri, Aug 28, 2009 at 10:44:56AM +0200, Ingo Molnar wrote:
>
>* Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>> James Bottomley (1):
>>       module: workaround duplicate section names
>
>-tip testing found that this patch breaks the build on x86 if 
>CONFIG_KALLSYMS is disabled:
>
> kernel/module.c: In function ‘load_module’:
> kernel/module.c:2367: error: ‘struct module’ has no member named ‘sect_attrs’
> distcc[8269] ERROR: compile kernel/module.c on ph/32 failed
> make[1]: *** [kernel/module.o] Error 1
> make: *** [kernel] Error 2
> make: *** Waiting for unfinished jobs....
>


Ouch..

>Commit 1b364bf misses the fact that section attributes are only 
>built and dealt with if kallsyms is enabled. The patch below fixes 
>this.
>
>( note, technically speaking this should depend on CONFIG_SYSFS as
>  well but this patch is correct too and keeps the #ifdef less
>  intrusive - in the KALLSYMS && !SYSFS case the code is a NOP. )
>
>Signed-off-by: Ingo Molnar <mingo@elte.hu>


I reviewed that patch. This one looks fine.

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>


Thanks!



>---
> kernel/module.c |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
>diff --git a/kernel/module.c b/kernel/module.c
>index eccb561..b4016d1 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -2355,8 +2355,10 @@ static noinline struct module *load_module(void __user *umod,
> 	if (err < 0)
> 		goto unlink;
> 	add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs);
>+#ifdef CONFIG_KALLSYMS
> 	if (mod->sect_attrs)
> 		add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs);
>+#endif
> 
> 	/* Get rid of temporary copy */
> 	vfree(hdr);
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2009-08-28  9:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28  1:24 Linux 2.6.31-rc8 Linus Torvalds
2009-08-28  8:22 ` Arnd Hannemann
2009-08-28  8:35   ` Ingo Molnar
2009-08-28  8:44 ` modules: Fix build error in the !CONFIG_KALLSYMS case Ingo Molnar
2009-08-28  9:24   ` Amerigo Wang [this message]
2009-08-28 12:07   ` James Bottomley
2009-08-28 12:14     ` Ingo Molnar
2009-08-28 12:11   ` Rusty Russell
2009-08-28 16:58 ` Linux 2.6.31-rc8 Eric Paris
2009-08-28 22:48 ` Alejandro Riveira Fernández

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=20090828092426.GC4849@cr0.nay.redhat.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=deller@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@linux-foundation.org \
    /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