From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id EB750BB81 for ; Thu, 11 Nov 2004 11:16:03 +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 iABAG3Ku025775 for ; Thu, 11 Nov 2004 11:16:03 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA05760 for ; Thu, 11 Nov 2004 11:16:03 +0100 (MET) Received: from alex.barettalocal.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iABAG21d005140 for ; Thu, 11 Nov 2004 11:16:02 +0100 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id 63FC3F38A8; Thu, 11 Nov 2004 11:18:07 +0100 (CET) Message-ID: <41933C5E.2010008@baretta.com> Date: Thu, 11 Nov 2004 11:18:06 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: it, en-us, en MIME-Version: 1.0 To: Ocaml Subject: Native executable symtable Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41933BE3.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41933BE2.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 baretta:01 symtable:01 binary:01 type-safety:01 byte:01 compilation:01 symtable:01 toplevel:01 bytecode:01 binary:01 runtime:01 bytecode:01 equivalently:01 runtime:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: We are writing a library implementing binary client-server protocol based on the Marshal module. In order to guarantee some degree of type-safety, during the handshaking phase of the communication we need the client to send the server the MD5 checksums of all relevant modules. The server process must verify that it has all the mentioned modules and that the checksums are consistent with its own. We are currently generating MD5 checksums from our source files with the md5sum command. These checksums are then assembled into a new source file which is compiled and linked into the both executables. This process works coherently for byte and native code, but it has at least one important drawback: all relevant modules must be available as source files for the md5 source file generation to work. Besides, this makes the compilation process exceedingly complex. We have found that the md5sum can be fetced directly from the executable file associated to the process. This technique is documented nowhere, as far as I can see, but the source code of Symtable.init_toplevel is very informative as to how to do this for bytecode executables. What I would like to know is how to implement this technique for native code executables. Essentially, how am I supposed to parse the binary executable to extract the symtable information. Also, how am I supposed to figure out at runtime whether I must use the bytecode method or the native code method? Equivalently, how do I know at runtime if the process is running a bytecode executable or a native one? Thank you very much. Alex -- ********************************************************************* 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/