Re: [PATCH] Show version information for built-in modules in sysfs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitry Torokhov
Date: Wednesday, December 22, 2010 - 5:38 pm

On Tue, Dec 21, 2010 at 05:48:45PM -0800, Rusty Russell wrote:

Whew, found it:

commit 4d62364652499ef106d1c0737968a879ef077bd4
Author: akpm <akpm>
Date:   Tue Jan 20 05:13:24 2004 +0000

    [PATCH] make gcc 3.4 compilation work

    From: David Mosberger <davidm@napali.hpl.hp.com>

    With gcc-3.4 we need "attribute((used))" declarations to get "make
    modules_install" to work.

    Otherwise these sections get dropped from the final image (I assume).

    BKrev: 400cb8f4ByHxZCElstAaZ3mBZ2oflQ

...

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 0a5becb..cbca007 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -52,6 +52,7 @@ struct kparam_array
 #define __module_param_call(prefix, name, set, get, arg, perm) \
        static char __param_str_##name[] __initdata = prefix #name; \
        static struct kernel_param const __param_##name \
+       __attribute_used__ \
     __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
        = { __param_str_##name, perm, set, get, arg }


Since we still claim to support GCC 3.4 I guess __used is still
needed...

Thanks,

Dmitry
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Show version information for built-in modules ..., Dmitry Torokhov, (Wed Dec 22, 5:38 pm)