* COMMON symbol warnings
@ 2007-09-06 17:38 Johannes Berg
2007-09-08 12:59 ` Ulrich Kunitz
2007-09-08 13:01 ` Christoph Hellwig
0 siblings, 2 replies; 8+ messages in thread
From: Johannes Berg @ 2007-09-06 17:38 UTC (permalink / raw)
To: linux-wireless; +Cc: Daniel Drake, Ulrich Kunitz, Tomas Winkler, Zhu Yi
[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]
After my compile run with __CHECK_ENDIAN__ the modules were built and I
got:
WARNING: "iwl_param_debug" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_disable_hw_scan" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_hwcrypto" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_antenna" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_disable" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_debug" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_disable_hw_scan" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_hwcrypto" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_antenna" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_disable" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbol
any idea what that means? It's from scripts/mod/modpost.c:
switch (sym->st_shndx) {
case SHN_COMMON:
warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name);
break;
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: COMMON symbol warnings
2007-09-06 17:38 COMMON symbol warnings Johannes Berg
@ 2007-09-08 12:59 ` Ulrich Kunitz
2007-09-08 13:01 ` Christoph Hellwig
1 sibling, 0 replies; 8+ messages in thread
From: Ulrich Kunitz @ 2007-09-08 12:59 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Daniel Drake, Tomas Winkler, Zhu Yi
Johannes Berg wrote:
> After my compile run with __CHECK_ENDIAN__ the modules were built and I
...
> WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
> WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbol
>
> any idea what that means? It's from scripts/mod/modpost.c:
> switch (sym->st_shndx) {
> case SHN_COMMON:
> warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name);
> break;
It looks like that modpost warns about symbols that are shared
between objects. In the zd1211rw case this is a extern symbol
shared between objects, but this has never created an issue.
Surely one could write a function which returns the pointer to
prevent the warning, but I can't see the definite necessity.
--
Uli Kunitz
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: COMMON symbol warnings
2007-09-06 17:38 COMMON symbol warnings Johannes Berg
2007-09-08 12:59 ` Ulrich Kunitz
@ 2007-09-08 13:01 ` Christoph Hellwig
2007-09-08 16:35 ` Michael Buesch
2007-09-10 11:08 ` Johannes Berg
1 sibling, 2 replies; 8+ messages in thread
From: Christoph Hellwig @ 2007-09-08 13:01 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-wireless, Daniel Drake, Ulrich Kunitz, Tomas Winkler,
Zhu Yi
On Thu, Sep 06, 2007 at 07:38:34PM +0200, Johannes Berg wrote:
> After my compile run with __CHECK_ENDIAN__ the modules were built and I
> got:
>
> WARNING: "iwl_param_debug" [drivers/net/wireless/iwl3945] is COMMON symbol
> WARNING: "iwl_param_disable_hw_scan" [drivers/net/wireless/iwl3945] is COMMON symbol
> WARNING: "iwl_param_hwcrypto" [drivers/net/wireless/iwl3945] is COMMON symbol
> WARNING: "iwl_param_antenna" [drivers/net/wireless/iwl3945] is COMMON symbol
> WARNING: "iwl_param_disable" [drivers/net/wireless/iwl3945] is COMMON symbol
> WARNING: "iwl_param_debug" [drivers/net/wireless/iwl4965] is COMMON symbol
> WARNING: "iwl_param_disable_hw_scan" [drivers/net/wireless/iwl4965] is COMMON symbol
> WARNING: "iwl_param_hwcrypto" [drivers/net/wireless/iwl4965] is COMMON symbol
> WARNING: "iwl_param_antenna" [drivers/net/wireless/iwl4965] is COMMON symbol
> WARNING: "iwl_param_disable" [drivers/net/wireless/iwl4965] is COMMON symbol
> WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
> WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbol
>
> any idea what that means?
Yes. It means a variable is declared in multiple places and the linker
merges it for you. The fix is to make sure these are declared extern in
all places but one.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: COMMON symbol warnings
2007-09-08 13:01 ` Christoph Hellwig
@ 2007-09-08 16:35 ` Michael Buesch
2007-09-09 8:50 ` Ulrich Kunitz
2007-09-10 11:08 ` Johannes Berg
1 sibling, 1 reply; 8+ messages in thread
From: Michael Buesch @ 2007-09-08 16:35 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Daniel Drake, Ulrich Kunitz
On Saturday 08 September 2007, Christoph Hellwig wrote:
> > WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
> > WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbol
> >
> > any idea what that means?
>
> Yes. It means a variable is declared in multiple places and the linker
> merges it for you. The fix is to make sure these are declared extern in
> all places but one.
Do you need an own workqueue in zd? Can you use the one mac80211 exports?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: COMMON symbol warnings
2007-09-08 16:35 ` Michael Buesch
@ 2007-09-09 8:50 ` Ulrich Kunitz
0 siblings, 0 replies; 8+ messages in thread
From: Ulrich Kunitz @ 2007-09-09 8:50 UTC (permalink / raw)
To: Michael Buesch; +Cc: Johannes Berg, linux-wireless, Daniel Drake
Michael Buesch wrote:
> On Saturday 08 September 2007, Christoph Hellwig wrote:
> > > WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
> > > WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbol
> > >
> > > any idea what that means?
> >
> > Yes. It means a variable is declared in multiple places and the linker
> > merges it for you. The fix is to make sure these are declared extern in
> > all places but one.
>
> Do you need an own workqueue in zd? Can you use the one mac80211 exports?
We could use the one mac80211 exports. This has been on my TODO
list for quite some time. But given the other problems we still
have, this hasn't been the highest priority. There is no bug here,
the only issue is that resource usage is a little bit higher. The
warning is from my point of view useless, because it is always
shown regardless whether there is a problem or not.
--
Uli Kunitz
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: COMMON symbol warnings
2007-09-08 13:01 ` Christoph Hellwig
2007-09-08 16:35 ` Michael Buesch
@ 2007-09-10 11:08 ` Johannes Berg
2007-09-10 12:14 ` Christoph Hellwig
1 sibling, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2007-09-10 11:08 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-wireless, Daniel Drake, Ulrich Kunitz, Tomas Winkler,
Zhu Yi
[-- Attachment #1: Type: text/plain, Size: 393 bytes --]
On Sat, 2007-09-08 at 14:01 +0100, Christoph Hellwig wrote:
> Yes. It means a variable is declared in multiple places and the linker
> merges it for you. The fix is to make sure these are declared extern in
> all places but one.
Interesting. So it's missing in a header file but sparse doesn't warn
about it like it does with functions that aren't declared nor static?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: COMMON symbol warnings
2007-09-10 11:08 ` Johannes Berg
@ 2007-09-10 12:14 ` Christoph Hellwig
2007-09-10 12:23 ` Johannes Berg
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2007-09-10 12:14 UTC (permalink / raw)
To: Johannes Berg
Cc: Christoph Hellwig, linux-wireless, Daniel Drake, Ulrich Kunitz,
Tomas Winkler, Zhu Yi
On Mon, Sep 10, 2007 at 01:08:12PM +0200, Johannes Berg wrote:
> On Sat, 2007-09-08 at 14:01 +0100, Christoph Hellwig wrote:
>
> > Yes. It means a variable is declared in multiple places and the linker
> > merges it for you. The fix is to make sure these are declared extern in
> > all places but one.
>
> Interesting. So it's missing in a header file but sparse doesn't warn
> about it like it does with functions that aren't declared nor static?
No. Say you have the following case:
----------- foo.h ------------
int foo;
----------- foo1.c -----------
#include "foo.h"
----------- foo2.c -----------
#include "foo.h"
--------- Makefile -----------
obj-m += foo.o
foo-y += foo1.o foo2.o
This gives you a foo COMMON symbol. But at least on i386 the kernel
is compiled with -fno-common so you get a warning like:
/home/hch/test/foo1.o:(.bss+0x0): multiple definition of `foo'
/home/hch/test/foo2.o:(.bss+0x0): first defined here
When adding -fcommon to EXTRA_FLAGS I get what you saw in this thread:
WARNING: "foo" [/home/hch/test/foo] is COMMON symbol
I wonder how the driver build managed to override our global -fno-common
setting.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: COMMON symbol warnings
2007-09-10 12:14 ` Christoph Hellwig
@ 2007-09-10 12:23 ` Johannes Berg
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2007-09-10 12:23 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-wireless, Daniel Drake, Ulrich Kunitz, Tomas Winkler,
Zhu Yi
[-- Attachment #1: Type: text/plain, Size: 834 bytes --]
On Mon, 2007-09-10 at 13:14 +0100, Christoph Hellwig wrote:
> No. Say you have the following case:
>
> ----------- foo.h ------------
> int foo;
> ----------- foo1.c -----------
> #include "foo.h"
> ----------- foo2.c -----------
> #include "foo.h"
> --------- Makefile -----------
> obj-m += foo.o
> foo-y += foo1.o foo2.o
>
>
> This gives you a foo COMMON symbol.
Ah, ok. I'm not familiar with these drivers though so I have no idea why
this happened, and then only with -D__CHECK_ENDIAN__.
> But at least on i386 the kernel
> is compiled with -fno-common so you get a warning like:
I'm building on powerpc. It has -fno-common as well.
> I wonder how the driver build managed to override our global -fno-common
> setting.
No idea. I guess the driver authors should look into it :)
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-09-10 12:22 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-06 17:38 COMMON symbol warnings Johannes Berg
2007-09-08 12:59 ` Ulrich Kunitz
2007-09-08 13:01 ` Christoph Hellwig
2007-09-08 16:35 ` Michael Buesch
2007-09-09 8:50 ` Ulrich Kunitz
2007-09-10 11:08 ` Johannes Berg
2007-09-10 12:14 ` Christoph Hellwig
2007-09-10 12:23 ` Johannes Berg
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).