Subject: Re: One LKM calls functions exported by another LKM
To: None <>
From: Quentin Garnier <>
List: tech-kern
Date: 03/09/2006 11:16:05
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 09, 2006 at 05:55:59PM +0800, George Chen wrote:
> Hi guys,
> I'm writing LKM (Loadable Kernel Module) and find I have to let LKM-A call
> functions exported by LKM-B. But I don't know how to implement it.
> The function is spucall(), declared as usual function in LKM-B.=20
> LKM-B: int spucall(int cmd);
> it is referred to in LKM-A as below.
> LKM-A: extern int spucall(int cmd);
> No warnings or errors were reported when making.
> I loaded LKM-A first. When I loaded LKM-B, it failed with following messa=
> apu.o(.text+0xef): In function `apu_handle':
> : undefined reference to `spucall'
> apu.o(.text+0xff): In function `apu_handle':
> : undefined reference to `spucall'
> modload: can't prelink `apu.o' creating `apu'
> No helpful messages were found in the web. Your instructions are highly
> appreciated!

Reading the manual page of modload(8) might prove useful, especially
the following bit:

     -s      Load the symbol table.

I encourage you, of course, to read the rest.

Quentin Garnier - -
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.6 (NetBSD)