From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 3832CBC37 for ; Fri, 17 Jul 2009 17:16:53 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvAIAFMzYErB/Bd4Ymdsb2JhbACZPBcICwcUBLcrhA0FgUA X-IronPort-AV: E=Sophos;i="4.42,417,1243807200"; d="scan'208";a="33182197" Received: from smtp-msa-out01.orange.fr ([193.252.23.120]) by mail1-smtp-roc.national.inria.fr with ESMTP; 17 Jul 2009 17:16:40 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2352.orange.fr (SMTP Server) with ESMTP id 36A7D70000A3; Fri, 17 Jul 2009 17:16:40 +0200 (CEST) Received: from [192.168.1.50] (APuteaux-154-1-88-148.w83-204.abo.wanadoo.fr [83.204.227.148]) by mwinf2352.orange.fr (SMTP Server) with ESMTP id 05B817000086; Fri, 17 Jul 2009 17:16:39 +0200 (CEST) X-ME-UUID: 20090717151640235.05B817000086@mwinf2352.orange.fr X-ME-User-Auth: lexifi Message-ID: <4A6095D6.9060905@frisch.fr> Date: Fri, 17 Jul 2009 17:16:38 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Ed Keith Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Manipulation objet files References: <169278.83498.qm@web58908.mail.re1.yahoo.com> In-Reply-To: <169278.83498.qm@web58908.mail.re1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 ocaml:01 mingw:01 gcc:01 cygwin:01 mingw:01 lib:01 gcc:01 lexifi:01 ocamlopt:01 compiler:01 wrote:01 avoids:01 caml-list:01 Ed Keith wrote: > Before I reinvent the wheel I thought I'd ask is anyone knows of any libraries, that can be accessed from ocaml, to read and write object files. In particular I need to read and write ELF files, Windows PE files, the .obj files generated by Visual C++ (I think there are PE files, but am not sure yet) and the .o files generated by mingw (I think there are a.out files, but am not sure yet). Visual C++ and gcc under Windows (Cygwin / MinGW) both produce COFF object files and static libraries (.obj/.lib, .o/.a), which can be linked to PE image files (.dll, .exe). Note that despite their suffix, objects and static libraries produced by gcc under Windows are regular COFF files. flexdll contains a module to parse COFF objects and libraries and write COFF objects (not libraries). The module has not been designed as a standalone library, just as a support module for flexdll (the same module is also used internally by LexiFi for our direct x86 COFF code generator for ocamlopt, which avoids the use of an external compiler), but it handles most of the COFF spec. There is also a minimal DLL writer in flexdll, but it is far from complete (e.g. it does not support embedding of Win32 resource files into the DLL). http://alain.frisch.fr/flexdll.html Regards, Alain