From owner-freebsd-amd64@FreeBSD.ORG Fri Aug 10 21:59:40 2007 Return-Path: Delivered-To: freebsd-amd64@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2BBD16A41A for ; Fri, 10 Aug 2007 21:59:40 +0000 (UTC) (envelope-from yrao@force10networks.com) Received: from mx.force10networks.com (corp.force10networks.com [64.186.164.204]) by mx1.freebsd.org (Postfix) with ESMTP id B837913C478 for ; Fri, 10 Aug 2007 21:59:40 +0000 (UTC) (envelope-from yrao@force10networks.com) Received: from mx.force10networks.com ([10.11.0.216]) by mx.force10networks.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 10 Aug 2007 15:00:15 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Fri, 10 Aug 2007 15:00:17 -0700 Message-ID: <9E2742C54E161041A53F36F9A8DC31BE32498B@EXCH-CLUSTER-04.force10networks.com> In-Reply-To: <200708101706.27543.jkim@FreeBSD.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: kldload issue: "Exec format error" with amd64 FreeBSD Thread-Index: AcfbkmkCIWkVpR6/QVC7lBdeaXAhPgABzzfw References: <9E2742C54E161041A53F36F9A8DC31BE32494A@EXCH-CLUSTER-04.force10networks.com> <200708101706.27543.jkim@FreeBSD.org> From: "Yong Rao" To: "Jung-uk Kim" , X-OriginalArrivalTime: 10 Aug 2007 22:00:15.0248 (UTC) FILETIME=[D4F25900:01C7DB99] Cc: Subject: RE: kldload issue: "Exec format error" with amd64 FreeBSD X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2007 21:59:40 -0000 Thanks, Jung-uk, for your information. I will take a look at those example modules. -----Original Message----- From: Jung-uk Kim [mailto:jkim@FreeBSD.org]=20 Sent: Friday, August 10, 2007 2:06 PM To: freebsd-amd64@FreeBSD.org Cc: Yong Rao Subject: Re: kldload issue: "Exec format error" with amd64 FreeBSD On Friday 10 August 2007 03:37 pm, Yong Rao wrote: > Hi, > > I am porting a device driver from 32 bit FreeBSD OS (6.2) to amd64 > (6.2-RELEASE-p7). > > The compiling passed without any problem. But while I do kldload > the module, we got problem. > > kldload: can't load ./pnicdrv.ko: Exec format error > > the dmesg displayed > > kldload: Unsupported file type > kldload: unexpected relocation type 7 > link_elf: symbol strcpy undefined > > What the problem is? Probably you have hardcoded CFLAGS/LDFLAGS? You cannot do that. =20 Also, you have to include bsd.kmod.mk at the end of your Makefile. > In the compiling option we added extra "-m64 -fPIC ...". What > particular options/flags else we should add in? You don't need -m64 nor -fPIC. > Is there example makefile(device driver code set) we can refer to? There are many examples in src/sys/modules. Jung-uk Kim