inter-kld module linking in ia64
Peter Wemm
peter at wemm.org
Thu Nov 13 08:51:08 PST 2003
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 at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
More information about the freebsd-ia64
mailing list