Converting libfoo.so for linux to freebsd

Miguel Mendez flynn at energyhq.es.eu.org
Tue Aug 9 21:37:18 GMT 2005


On Tue, 09 Aug 2005 13:37:34 -0600 (MDT)
"M. Warner Losh" <imp at bsdimp.com> 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,
-- 
Miguel Mendez <flynn at energyhq.es.eu.org>
http://www.energyhq.es.eu.org
PGP Key: 0xDC8514F1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20050809/f7ddcc8b/attachment.bin


More information about the freebsd-hackers mailing list