Date: Fri, 10 Aug 2007 15:00:17 -0700 From: "Yong Rao" <yrao@force10networks.com> To: "Jung-uk Kim" <jkim@FreeBSD.org>, <freebsd-amd64@FreeBSD.org> Subject: RE: kldload issue: "Exec format error" with amd64 FreeBSD Message-ID: <9E2742C54E161041A53F36F9A8DC31BE32498B@EXCH-CLUSTER-04.force10networks.com> In-Reply-To: <200708101706.27543.jkim@FreeBSD.org> References: <9E2742C54E161041A53F36F9A8DC31BE32494A@EXCH-CLUSTER-04.force10networks.com> <200708101706.27543.jkim@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9E2742C54E161041A53F36F9A8DC31BE32498B>