From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id A0376BB81 for ; Thu, 11 Nov 2004 12:09:10 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iABB9ARn031746 for ; Thu, 11 Nov 2004 12:09:10 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA07346 for ; Thu, 11 Nov 2004 12:09:09 +0100 (MET) Received: from mail.barettadeit.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iABB993k031742 for ; Thu, 11 Nov 2004 12:09:09 +0100 Received: from [10.0.0.115] (table [10.0.0.115]) by mail.barettadeit.com (Postfix) with ESMTP id F0783802865F for ; Thu, 11 Nov 2004 12:09:06 +0100 (CET) Message-ID: <41934852.8020102@yahoo.it> Date: Thu, 11 Nov 2004 12:09:06 +0100 From: Luca Pascali User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Native executable symtable References: <41933C5E.2010008@baretta.com> <017f01c4c7da$be6aba40$ef01a8c0@warp> In-Reply-To: <017f01c4c7da$be6aba40$ef01a8c0@warp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41934856.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41934855.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 symtable:01 cannasse:01 wrote:01 bytecode:01 cmo:01 ocaml:01 cannasse:01 bytecode:01 compiler:01 compilation:01 ocaml:01 mutable:01 toplevel:01 baretta:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.6 required=5.0 tests=FORGED_RCVD_HELO, FROM_ENDS_IN_NUMS autolearn=disabled version=3.0.0 X-Spam-Level: Nicolas Cannasse wrote: > [...] > >I would say this is very difficult since it depends on linker used to >produce executable. >For bytecode things are always very easy since the CMO/CMA are just >Marshalled data of some ocaml data structure. As always, it get complicated >when you deal with system specificity issues. > >Regards, >Nicolas Cannasse > > I can say that informations about signatures of used modules are present in both the bytecode and native executables. I saw a macroscopical difference between those two results is that in the bytecode compiler, at the end of the file, there is a TOC section that gives informations about the header sections. One of this sections (named CRCS) is the one with the signatures. In the native compilation, these informations are not lost (at least with Ocaml 3.07+2 under Linux. Correct me if I am wrong). But how can we access those informations? Module Sys gives a mutable value that says if we are running under a toplevel or not (Sys.interactive), too bad there's not something that says us if we are using a bytecode compiled application or not. A method can be looking for the TOC for knowing if the application is bytecode or native. In case of bytecode file, the TOC says us where the CRCS are located into the file. But at which offset we can found those CRCS in the native code compiled? Thanks in advance Luca -- ********************************************************************* Luca Pascali luca@barettadeit.com asxcaml-guru@barettadeit.com http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. 02 370 111 55 fax. 02 370 111 54 Our technology: http://www.asxcaml.org/ http://www.freerp.org/