Section mismatch in drivers/net/ne.o during modpost
Subsystems (2)
While compiling 2.6.17-rc6 for a 486 with an NE2000 ISA ethernet card, I got:
Building modules, stage 2.
make -rR -f /tmp/linux-2.6.17-rc6/scripts/Makefile.modpost
scripts/mod/modpost -o /tmp/linux-2.6.17-rc6/Module.symvers vmlinux drivers/net/8390.o drivers/net/ne.o lib/crc32.o net/packet/af_packet.o
WARNING: drivers/net/ne.o - Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset 0x158) and 'ne_block_input'
WARNING: drivers/net/ne.o - Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset 0x176) and 'ne_block_input'
WARNING: drivers/net/ne.o - Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset 0x183) and 'ne_block_input'
WARNING: drivers/net/ne.o - Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset 0x1ea) and 'ne_block_input'
WARNING: drivers/net/ne.o - Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset 0x251) and 'ne_block_input'
WARNING: drivers/net/ne.o - Section mismatch: reference to .init.text: from .text between 'init_module' (at offset 0x266) and 'ne_block_input'
WARNING: drivers/net/ne.o - Section mismatch: reference to .init.text: from .text between 'init_module' (at offset 0x29b) and 'ne_block_input'
Not sure how serious this is; the driver seems to work fine later on.
/Mikael
PATCH 1/1 Section mismatch in drivers/net/ne.o during modpost
Quoted 11 lines · On Sat, 10 Jun 2006 14:11:42 +0200 (MEST) Mikael Pettersson wrote:
While compiling 2.6.17-rc6 for a 486 with an NE2000 ISA ethernet card, I got:
WARNING:
drivers/net/ne.o- Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset0x158) and 'ne_block_input'
WARNING:drivers/net/ne.o- Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset0x176) and 'ne_block_input'
WARNING:drivers/net/ne.o- Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset0x183) and 'ne_block_input'
WARNING:drivers/net/ne.o- Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset0x1ea) and 'ne_block_input'
WARNING:drivers/net/ne.o- Section mismatch: reference to .init.data:isapnp_clone_list from .text between 'init_module' (at offset0x251) and 'ne_block_input'
WARNING:drivers/net/ne.o- Section mismatch: reference to .init.text: from .text between 'init_module' (at offset0x266) and 'ne_block_input'
WARNING:drivers/net/ne.o- Section mismatch: reference to .init.text: from .text between 'init_module' (at offset0x29b) and 'ne_block_input'Not sure how serious this is; the driver seems to work fine later on.
Doesn't look serious. init_module() is not __init, but it calls some __init functions and touches some __initdata.
BTW, I would be happy to see some consistent results from modpost section checking. I don't see all of these warnings (I see only 1) when using gcc 3.3.6. What gcc version are you using? Does that matter? (not directed at anyone in particular)
Patch below fixes it for me. Please test/report.
---
From: Randy Dunlap <[email protected]>
Fix section mismatch warnings:
WARNING: drivers/net/ne.o - Section mismatch: reference to .init.text: from .text between 'init_module' (at offset 0x396) and 'cleanup_card'
WARNING: drivers/net/ne2.o - Section mismatch: reference to .init.text: from .text between 'init_module' (at offset 0x483) and 'cleanup_card'
--- drivers/net/ne.c | 2 +- drivers/net/ne2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ne.c +1 -1
@@ -829,7 +829,7 @@ that the ne2k probe is the last 8390 basis at boot) and so the probe will get confused by any other 8390 cards. ISA device autoprobes on a running machine are not recommended anyway. */ -int init_module (void ) +int __init init_module (void ) {int this_dev, found =0 ;
drivers/net/ne2.c +1 -1
@@ -780,7 +780,7 @@ MODULE_PARM_DESC(bad, "(ignored)");/* Module code fixed by David Weinehall */ -int init_module (void ) +int __init init_module (void ) {struct net_device *dev;int this_dev, found =0 ;
Quoted 5 lines
Quoted 2 lines
Not sure how serious this is; the driver seems to work fine later on.
Doesn't look serious.
init_module()is not__init, but it calls some__initfunctions and touches some__initdata.
This is the typical case with inconsistent tagging.
Quoted 4 lines
BTW, I would be happy to see some consistent results from modpost section checking. I don't see all of these warnings (I see only 1) when using gcc 3.3.6. What gcc version are you using? Does that matter? (not directed at anyone in particular)
I did not see anyone of them - strange.
I did not dig into it, but objdump -rR ne.o should tell the number of mismatches with soem carefull checking.
drivers/net/ne.c that the ne2k probe is the last 8390 bas · line 834
Quoted 10 lines
drivers/net/ne.c +1
-1@@ -829,7 +829,7 @@ that the ne2k probe is the last 8390 basis at boot) and so the probe will get confused by any other 8390 cards. ISA device autoprobes on a running machine are not recommended anyway. */ -int init_module (void ) +int __init init_module (void ) {int this_dev, found =0 ;
When you anyway touches the driver I suggest to name the function <module>_init, <module>_cleanup and use module_init(), module_cleanup().
Sam
Quoted 5 lines
Quoted 2 lines
Doesn't look serious.
init_module()is not__init, but it calls some__initfunctions and touches some__initdata.This is the typical case with inconsistent tagging.
Worse yet, I once experienced a double-definition error, that is, I had
__init int init_module(void) {
/* module1 */
}and, in another .c file,
__init int init_module(void) {
/* module2 */
}and making them both CONFIG_...=y gave a typical double-definition link time error in vmlinux. The proper way (IMO) is
static __init int blah_init(void) { ... }
module_init(blah_init);Then it does not even matter if blah_init is defined in two different modules.
Quoted 8 lines
drivers/net/ne.c that the ne2k probe is the last 8390 bas · line 834
Quoted 5 lines
drivers/net/ne.c +1
-1-int init_module (void ) +int __init init_module (void ) {int this_dev, found =0 ;When you anyway touches the driver I suggest to name the function <module>_init, <module>_cleanup and use
module_init(),module_cleanup().
Jan Engelhardt