Subject: Re: One LKM calls functions exported by another LKM
To: None <george.chen@semptian.com>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 03/09/2006 11:16:05
--N5b0NsBGdE2hIyw+
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:
>=20
> Hi guys,
>=20
> 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.
>=20
> The function is spucall(), declared as usual function in LKM-B.=20
> LKM-B: int spucall(int cmd);
>=20
> it is referred to in LKM-A as below.
> LKM-A: extern int spucall(int cmd);
>=20
> No warnings or errors were reported when making.
>=20
> I loaded LKM-A first. When I loaded LKM-B, it failed with following messa=
ge
>=20
> 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'
>=20
> 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.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"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.

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBRBAAZdgoQloHrPnoAQIV+QgAtmsIzXJZVlrq+mmAz638r7kf33U+gPD6
GFJ10wk4CYa0c/Rl2Ch4BB1vr/B1QwECqlVrCePBv9PV6s0HsNz859LmK0BRJ/ZD
fWXp3BXtQxkSsVevF3jiHxnFBQuaALg7T2LUYZlMOz2Gm+3Sr1hbD9YfPdoxodEr
Z9znHyeMSuwA1qqIf+iHmlHvB/nwaIRsSNWSOUMM3HpyFf1Q7iias15ZZyad8Ebi
qdmyKWmZfuCzo4sVjLhcoU2kTgGI2YKKsIPz9c8THj3yX2O306EXhpO0V6ubOb5s
P8qd+1AIIBZRYKL/PlNVDLJHH0rgg/ppV20umuhvF4av9zde9JoRwg==
=FgMD
-----END PGP SIGNATURE-----

--N5b0NsBGdE2hIyw+--