module symbol fix
PATCH 1/1 module symbol fix
Hi,
recent gcc versions need this one ...
Gerd
arch/um/kernel/user_syms.c renamed from arch/um/kernel/user_syms.c.uml +1 -0
@@ -57,6 +57,7 @@ __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #sym; \ static const struct kernel_symbol __ksymtab_##sym \ + __attribute_used__ \ __attribute__((section("__ksymtab" sec), unused)) \ = { (unsigned long)&sym, __kstrtab_##sym }
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 3 lines · Gerd Knorr
Hi,
recent gcc versions need this one ...
Another one of this kind (without this gcc may optimizes away the static declared but unreferenced stuff, resulting in initrd= and --help options not working any more for example ...).
Gerd
arch/um/include/init.h renamed from arch/um/include/init.h.used +7 -7
@@ -40,9 +40,9 @@typedef int (*initcall_t )(void );typedef void (*exitcall_t )(void ); -#define __init __attribute__ ((__section__ (".text.init"))) +#define __init __attribute__ ((used,__section__ (".text.init")))#define __exit __attribute__ ((unused, __section__(".text.exit"))) -#define __initdata __attribute__ ((__section__ (".data.init"))) +#define __initdata __attribute__ ((used,__section__ (".data.init")))#endif
@@ -94,11 +94,11 @@* Mark functions and data as being only used at initialization * or exit time. */ -#define __uml_init_setup __attribute__ ((unused,__section__ (".uml.setup.init"))) -#define __uml_setup_help __attribute__ ((unused,__section__ (".uml.help.init"))) -#define __uml_init_call __attribute__ ((unused,__section__ (".uml.initcall.init"))) -#define __uml_postsetup_call __attribute__ ((unused,__section__ (".uml.postsetup.init"))) -#define __uml_exit_call __attribute__ ((unused,__section__ (".uml.exitcall.exit"))) +#define __uml_init_setup __attribute__ ((used,__section__ (".uml.setup.init"))) +#define __uml_setup_help __attribute__ ((used,__section__ (".uml.help.init"))) +#define __uml_init_call __attribute__ ((used,__section__ (".uml.initcall.init"))) +#define __uml_postsetup_call __attribute__ ((used,__section__ (".uml.postsetup.init"))) +#define __uml_exit_call __attribute__ ((used,__section__ (".uml.exitcall.exit")))#endif /* _LINUX_UML_INIT_H */
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Alle 10:26, venerdì 27 febbraio 2004, Gerd Knorr ha scritto:
Quoted 8 lines · Gerd Knorr
Quoted 3 lines
Hi,
recent gcc versions need this one ...
Another one of this kind (without this gcc may optimizes away the static declared but unreferenced stuff, resulting in initrd= and --help options not working any more for example ...).
Yes, but it needs to be made work with older gcc, even 2.95.3 but also 3.2 - and this means using __attribute__(__unused__) if needed - i.e. using __attribute__used as in the first patch (using more than one attribute works, as in include/linux/init.h).
The problem is that init.h is included even in userspace modules so it cannot include kernel headers - also, it seems that user_syms.c does not include <linux/compiler.h> and so __attribute_used cannot be expanded simply. If it works on you, check if the define comes from /usr/include/linux/compiler.h.
Duplicating the version check from include/linux/compiler* will be needed to avoid the problems you pointed out and possibly others, but not being able to include linux/* in user-objs is increasingly sucking. Sadly there are reasons for this and they are good (I discovered this while trying to remove this limitation):
- user space headers include /usr/include/linux/*, so if you add -I<source tree root>/include, those headers will include _other_ linux headers and things will not work - especially, they will include <source tree root>/include/asm-um/* instead of /usr/include/asm/*.
- definitions depending on CONFIG_* would be messed up; in fact, uml-config.h is a translation of config.h which defines UML_CONFIG_* instead of CONFIG_*, because CONFIG_* macros are defined by /usr/include/linux/autoconf.h. So if an "user-objs" file includes linux/mm.h, that header could even think that CONFIG_HIGHMEM is defined because the distro said so!
Signature · 14 lines
Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&opÌk _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel