Issue
On a Linux 2.4.25 system I have two loadable kernel modules, com20020
and xsoe
. These modules should be independent of each other, but /proc/modules
has the lines
xsoe 4528 0 (unused)
com20020 10112 0 [xsoe]
- saying that xsoe
is referring to com20020
. Perhaps there is a programming error so that xsoe
inadvertently uses a symbol from com20020
. How can I find the cause of this dependency (preferably without unloading com20020
)? (depmod -n
offers no clue.)
Solution
I looked at /proc/ksyms
for suspicious symbols in com20020
which might also appear in the source of xsoe
; eventually I saw the line
d129e694 debug [com20020]
there. Both the sources of com20020
and xsoe
had the definitions unsigned debug;
MODULE_PARM(debug, "i");
and in the outputs of nm com20020.o
and nm xsoe.o
the symbol appeared as common:
00000004 C debug
The cure was to define the object debug
to have internal linkage (storage-class
static
).
The search for common symbols could be automated with a bash
command like
join -j 3 <(nm com20020.o) <(nm xsoe.o)|grep C$
Answered By - Armali