* modpost warning question
@ 2007-07-25 7:14 Kumar Gala
2007-07-25 7:27 ` Sam Ravnborg
2007-07-25 7:55 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 7+ messages in thread
From: Kumar Gala @ 2007-07-25 7:14 UTC (permalink / raw)
To: sam; +Cc: linuxppc-dev, linux-kernel, Jeff Garzik, netdev
I'm seeing the following warning:
WARNING: vmlinux.o(.init.text+0x1acdc): Section mismatch: reference to
.exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')
I don't understand why its not ok to access .exit.text from .init.text
The following addresses the issue, however I don't particularly like it:
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index ac3596f..100bf41 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -245,7 +245,7 @@ int __init gfar_mdio_init(void)
return driver_register(&gianfar_mdio_driver);
}
-void __exit gfar_mdio_exit(void)
+void gfar_mdio_exit(void)
{
driver_unregister(&gianfar_mdio_driver);
}
diff --git a/drivers/net/gianfar_mii.h b/drivers/net/gianfar_mii.h
index 5d34004..b373091 100644
--- a/drivers/net/gianfar_mii.h
+++ b/drivers/net/gianfar_mii.h
@@ -42,5 +42,5 @@ struct gfar_mii {
int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
int __init gfar_mdio_init(void);
-void __exit gfar_mdio_exit(void);
+void gfar_mdio_exit(void);
#endif /* GIANFAR_PHY_H */
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: modpost warning question
2007-07-25 7:14 modpost warning question Kumar Gala
@ 2007-07-25 7:27 ` Sam Ravnborg
2007-07-25 7:49 ` Kumar Gala
2007-07-25 10:08 ` chengong
2007-07-25 7:55 ` Benjamin Herrenschmidt
1 sibling, 2 replies; 7+ messages in thread
From: Sam Ravnborg @ 2007-07-25 7:27 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, linux-kernel, Jeff Garzik, netdev
On Wed, Jul 25, 2007 at 02:14:12AM -0500, Kumar Gala wrote:
> I'm seeing the following warning:
>
> WARNING: vmlinux.o(.init.text+0x1acdc): Section mismatch: reference to
> .exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')
>
> I don't understand why its not ok to access .exit.text from .init.text
Several architectures discards .exit.text in the final linker
script (arch/$(ARCH)/kernel/vmlinux.lds.S
So any references to .exit.text will when a module is build-in result
in a linker error because ld will flag it as an error when we reference
a symbol in a discarded section.
For the popular architectures (i386,x86_64) we discard .exit.text at
runtime so here we do not see the error from ld (sadly).
Sam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: modpost warning question
2007-07-25 7:27 ` Sam Ravnborg
@ 2007-07-25 7:49 ` Kumar Gala
2007-07-25 7:52 ` Sam Ravnborg
2007-07-25 10:08 ` chengong
1 sibling, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2007-07-25 7:49 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linuxppc-dev, linux-kernel, Jeff Garzik, netdev
On Jul 25, 2007, at 2:27 AM, Sam Ravnborg wrote:
> On Wed, Jul 25, 2007 at 02:14:12AM -0500, Kumar Gala wrote:
>> I'm seeing the following warning:
>>
>> WARNING: vmlinux.o(.init.text+0x1acdc): Section mismatch:
>> reference to
>> .exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')
>>
>> I don't understand why its not ok to access .exit.text
>> from .init.text
>
> Several architectures discards .exit.text in the final linker
> script (arch/$(ARCH)/kernel/vmlinux.lds.S
>
> So any references to .exit.text will when a module is build-in result
> in a linker error because ld will flag it as an error when we
> reference
> a symbol in a discarded section.
>
> For the popular architectures (i386,x86_64) we discard .exit.text at
> runtime so here we do not see the error from ld (sadly).
Fair point, wondering what we do with .exit on PPC, another thing for
the list :)
- k
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: modpost warning question
2007-07-25 7:27 ` Sam Ravnborg
2007-07-25 7:49 ` Kumar Gala
@ 2007-07-25 10:08 ` chengong
2007-07-25 11:45 ` Sam Ravnborg
1 sibling, 1 reply; 7+ messages in thread
From: chengong @ 2007-07-25 10:08 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linuxppc-dev, netdev, Jeff Garzik, linux-kernel
On Wed, 2007-07-25 at 09:27 +0200, Sam Ravnborg wrote:
> On Wed, Jul 25, 2007 at 02:14:12AM -0500, Kumar Gala wrote:
> > I'm seeing the following warning:
> >
> > WARNING: vmlinux.o(.init.text+0x1acdc): Section mismatch: reference to
> > .exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')
> >
> > I don't understand why its not ok to access .exit.text from .init.text
>
> Several architectures discards .exit.text in the final linker
> script (arch/$(ARCH)/kernel/vmlinux.lds.S
>
> So any references to .exit.text will when a module is build-in result
> in a linker error because ld will flag it as an error when we reference
> a symbol in a discarded section.
But why? Just make kernel size smaller?
>
> For the popular architectures (i386,x86_64) we discard .exit.text at
> runtime so here we do not see the error from ld (sadly).
>From which version? On my machine I have seen the same problem when
building i386 target with the version 2.6.21.
>
> Sam
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: modpost warning question
2007-07-25 10:08 ` chengong
@ 2007-07-25 11:45 ` Sam Ravnborg
0 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2007-07-25 11:45 UTC (permalink / raw)
To: chengong; +Cc: linuxppc-dev, netdev, Jeff Garzik, linux-kernel
On Wed, Jul 25, 2007 at 06:08:03PM +0800, chengong wrote:
> On Wed, 2007-07-25 at 09:27 +0200, Sam Ravnborg wrote:
> > On Wed, Jul 25, 2007 at 02:14:12AM -0500, Kumar Gala wrote:
> > > I'm seeing the following warning:
> > >
> > > WARNING: vmlinux.o(.init.text+0x1acdc): Section mismatch: reference to
> > > .exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')
> > >
> > > I don't understand why its not ok to access .exit.text from .init.text
> >
> > Several architectures discards .exit.text in the final linker
> > script (arch/$(ARCH)/kernel/vmlinux.lds.S
> >
> > So any references to .exit.text will when a module is build-in result
> > in a linker error because ld will flag it as an error when we reference
> > a symbol in a discarded section.
> But why? Just make kernel size smaller?
Yes - that the whole goal of init/exit sections.
> >
> > For the popular architectures (i386,x86_64) we discard .exit.text at
> > runtime so here we do not see the error from ld (sadly).
> >From which version? On my machine I have seen the same problem when
> building i386 target with the version 2.6.21.
modpost has started to warn about it. I assume you did not see link errors.
Sam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: modpost warning question
2007-07-25 7:14 modpost warning question Kumar Gala
2007-07-25 7:27 ` Sam Ravnborg
@ 2007-07-25 7:55 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2007-07-25 7:55 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, sam, linux-kernel, Jeff Garzik, netdev
On Wed, 2007-07-25 at 02:14 -0500, Kumar Gala wrote:
> I'm seeing the following warning:
>
> WARNING: vmlinux.o(.init.text+0x1acdc): Section mismatch: reference to
> .exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')
>
> I don't understand why its not ok to access .exit.text from .init.text
>
> The following addresses the issue, however I don't particularly like it:
Because exit.text is removed when compiling built-in
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-07-25 11:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-25 7:14 modpost warning question Kumar Gala
2007-07-25 7:27 ` Sam Ravnborg
2007-07-25 7:49 ` Kumar Gala
2007-07-25 7:52 ` Sam Ravnborg
2007-07-25 10:08 ` chengong
2007-07-25 11:45 ` Sam Ravnborg
2007-07-25 7:55 ` Benjamin Herrenschmidt
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).