From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 9 21:37:18 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6CADD16A425 for ; Tue, 9 Aug 2005 21:37:18 +0000 (GMT) (envelope-from flynn@energyhq.es.eu.org) Received: from mindfields.energyhq.es.eu.org (73.Red-213-97-200.pooles.rima-tde.net [213.97.200.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2587343D55 for ; Tue, 9 Aug 2005 21:37:09 +0000 (GMT) (envelope-from flynn@energyhq.es.eu.org) Received: from scienide.energyhq.es.eu.org (scienide.energyhq.es.eu.org [192.168.100.1]) by mindfields.energyhq.es.eu.org (Postfix) with SMTP id B82BB123FCA; Tue, 9 Aug 2005 23:37:06 +0200 (CEST) Date: Tue, 9 Aug 2005 23:36:57 +0200 From: Miguel Mendez To: "M. Warner Losh" Message-Id: <20050809233657.745c41b4.flynn@energyhq.es.eu.org> In-Reply-To: <20050809.133734.08360256.imp@bsdimp.com> References: <20050809.133734.08360256.imp@bsdimp.com> X-Mailer: Sylpheed version 2.0.0 (GTK+ 2.6.9; amd64-portbld-freebsd5.4) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Tue__9_Aug_2005_23_36_57_+0200_6BEGAe4z2xq3eR+Q" Cc: hackers@freebsd.org Subject: Re: Converting libfoo.so for linux to freebsd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2005 21:37:18 -0000 --Signature=_Tue__9_Aug_2005_23_36_57_+0200_6BEGAe4z2xq3eR+Q Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 09 Aug 2005 13:37:34 -0600 (MDT) "M. Warner Losh" wrote: > I have recently purcahsed a device that comes with a .so for linux, > but no sources. Is there any way one can take an arbitrary linux .so > which appears to have no dependencies to a FreeBSD .so? The binary > code is about 20k or so. Could you be a bit more specific wrt dependencies? Does the device in question provide an API via said .so and a .h? You could try using ndisasm (from the /devel/nasm port) or a perl script called dasm that calls objdump and see if you can get something usable from there. If the .so is small it shouldn't be that much work, although it might be more practical to derive the interface code from the asm output (i.e. reverse engineer) than try to shoehorn the resulting .S into a FreeBSD .so. The other alternative would be building a Linux binary as Kris has suggested, although I suspect that this .so is involved in some sort of i/o which might or might not be easily ported to FreeBSD. Cheers, --=20 Miguel Mendez http://www.energyhq.es.eu.org PGP Key: 0xDC8514F1 --Signature=_Tue__9_Aug_2005_23_36_57_+0200_6BEGAe4z2xq3eR+Q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFC+SH8nLctrNyFFPERAjizAKCmiWrwdPcKFPXWc4I0P8df2feamwCeNGIP LLVA6TPYRLEeu2AprO5886k= =v78V -----END PGP SIGNATURE----- --Signature=_Tue__9_Aug_2005_23_36_57_+0200_6BEGAe4z2xq3eR+Q--