From owner-freebsd-ia64@FreeBSD.ORG Thu Nov 13 08:51:08 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 667A116A4CE for ; Thu, 13 Nov 2003 08:51:08 -0800 (PST) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id C754443FE0 for ; Thu, 13 Nov 2003 08:51:05 -0800 (PST) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id B3ACC2A8FB; Thu, 13 Nov 2003 08:51:05 -0800 (PST) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: Alan.Robinson@fujitsu-siemens.com In-Reply-To: <20031113114543.A8735@fujitsu-siemens.com> Date: Thu, 13 Nov 2003 08:51:05 -0800 From: Peter Wemm Message-Id: <20031113165105.B3ACC2A8FB@canning.wemm.org> cc: freebsd-ia64@freebsd.org Subject: Re: inter-kld module linking in ia64 X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2003 16:51:08 -0000 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 ' 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