Subject: Loading LKMs at boot yields unresolved symbols, but from commandline
To: None <netbsd-users@NetBSD.org>
From: Jeff Rizzo <riz@boogers.sf.ca.us>
List: netbsd-users
Date: 03/04/2005 09:32:02
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig00B690F440415F6A3E4D6537
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
I've been working on some LKMs for a while (zaptel drivers for NetBSD),
and an issue that's been bugging me for a while is finally annoying
enough for me to try and figure out what's causing it.
The problem: if I load the LKMs from the commandline, it's fine.
However, when I configure things in lkm.conf for boot-time load, I get
undefined reference errors. This is *with* the -s flag.
Loading from commandline:
slim:riz ~/code/zaptel> sudo modload -s /usr/lkm/mod_zaptel.o
Module loaded as ID 0
slim:riz ~/code/zaptel> sudo modload -s /usr/lkm/mod_ztdummy.o
Module loaded as ID 1
At boot time:
Module loaded as ID 0
mod_ztdummy.o: /usr/lkm/mod_ztdummy.o(.text+0x12f): In function
`ztdummy_initialize':
/home/riz/code/zaptel/ztdummy/ztdummy.c:101: undefined reference to
`zt_register'
/usr/lkm/mod_ztdummy.o(.text+0x250): In function `cleanup_module':
/home/riz/code/zaptel/ztdummy/ztdummy.c:152: undefined reference to
`zt_unregister'
/usr/lkm/mod_ztdummy.o(.text+0x3f6): In function `ztdummy_timer':
/home/riz/code/zaptel/ztdummy/ztdummy.c:75: undefined reference to
`zt_receive'
/usr/lkm/mod_ztdummy.o(.text+0x402):/home/riz/code/zaptel/ztdummy/ztdummy.c:76:
undefined reference to `zt_transmit'
modload: can't prelink `/usr/lkm/mod_ztdummy.o' creating
`/usr/lkm/mod_ztdummy'
... the first module loads, but the second (which requires symbols from
the first) doesn't. Here's what /etc/lkm.conf looks like:
# path options entry postinstall
output when
#/lkm/if_ipl.o - - -
- -
/usr/lkm/mod_zaptel.o -s - - - AFTERMOUNT
/usr/lkm/mod_ztdummy.o -s - - - AFTERMOUNT
... as you can see, I _do_ have the -s flag in there. Even more
interesting, someone else using this code (also on a 2.0 system, like
this one) is NOT seeing this problem.
What am I doing wrong, here?
Thanks,
+j
--------------enig00B690F440415F6A3E4D6537
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (Darwin)
iQCVAwUBQiiblrOuUtxCgar5AQJi0AP/eINWj5Qd21jRxHwUGTHgA6rqo9YWddN6
kdk5moVk9MG5WXiH7dM1BkgepX06sbQP63WVDG8m9LM62McByZxXdRk7Ent4F48q
PhvZvne8Uxv83ORnmZMaM7ZMG5OrxQ4j9cmSDon3Yer9JAPcVmDzmOVfbd8e828i
PxHDw4F00u4=
=HsK+
-----END PGP SIGNATURE-----
--------------enig00B690F440415F6A3E4D6537--