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 A30F9BB81 for ; Thu, 11 Nov 2004 11:40:17 +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 iABAeHgP028954 for ; Thu, 11 Nov 2004 11:40:17 +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 LAA06155 for ; Thu, 11 Nov 2004 11:40:16 +0100 (MET) Received: from smtp.cegetel.net (mf00.sitadelle.com [212.94.174.77]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iABAeGxe008857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 11 Nov 2004 11:40:16 +0100 Received: from warp (80-125-126-22.dti.cegetel.net [80.125.126.22]) by smtp.cegetel.net (Postfix) with SMTP id E9494671C8; Thu, 11 Nov 2004 11:40:13 +0100 (CET) Message-ID: <017f01c4c7da$be6aba40$ef01a8c0@warp> From: "Nicolas Cannasse" To: "Alex Baretta" , References: <41933C5E.2010008@baretta.com> Subject: Re: [Caml-list] Native executable symtable Date: Thu, 11 Nov 2004 11:39:35 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Miltered: at nez-perce with ID 41934191.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41934190.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 symtable:01 symtable:01 toplevel:01 bytecode:01 binary:01 runtime:01 bytecode:01 equivalently:01 runtime:01 cmo:01 ocaml:01 cannasse: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 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 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