Date: Thu, 13 Nov 2003 08:51:05 -0800 From: Peter Wemm <peter@wemm.org> To: Alan.Robinson@fujitsu-siemens.com Cc: freebsd-ia64@freebsd.org Subject: Re: inter-kld module linking in ia64 Message-ID: <20031113165105.B3ACC2A8FB@canning.wemm.org> In-Reply-To: <20031113114543.A8735@fujitsu-siemens.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Alan Robinson wrote: > > Hi Folks, > > Using FreeBSD 5.1 on a ia64 machine: > > I have two kld driver modules (in different .ko files) one > (B.ko) of which depends, function call, on the other > (A.ko). When I kldload A.ko it loads as expected and > links correctly into the kernel. When I kldload B.ko > I get and error from kldload and the message > > "kernel: link_elf: symbol A_status undefined" > > I have EXPORT_SYMS=YES set in (both) driver Makefiles, > before the '.include <bsd.kmod.mk>' and the nm output > looks OK to me. > > $ nm A.ko | grep A_status > 00000a60 T A_status > > $ nm B.ko | grep A_status > U A_status > > Is this expected behaviour or is it a ia64'isim. Suggestions > and pointers to more information welcome. You need to specify an inter-module dependency otherwise the symbol search order will not include the module you are looking for. For example, you want a MODULE_VERSION(A, 1); in A.ko, and MODULE_DEPEND(A, 1, 1, 1); in B.ko. That will prevent A being unloaded while B has symbol references to it, and will allow B to use A's symbols. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031113165105.B3ACC2A8FB>