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 E7623BB81 for ; Thu, 11 Nov 2004 12:55:30 +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 iABBtUvd003915 for ; Thu, 11 Nov 2004 12:55:30 +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 MAA09277 for ; Thu, 11 Nov 2004 12:55:30 +0100 (MET) Received: from mta1.cl.cam.ac.uk (mta1.cl.cam.ac.uk [128.232.0.15]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iABBtTLF018116 for ; Thu, 11 Nov 2004 12:55:29 +0100 Received: from zonule.cl.cam.ac.uk ([128.232.9.23] helo=cl.cam.ac.uk ident=[HXotQIS30QLLE1jjBhF4NO0Vp86iEC8Q]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1CSDY0-0003af-00; Thu, 11 Nov 2004 11:55:28 +0000 X-Mailer: exmh version 2.6.3-CL 04/04/2003 with nmh-1.0.4 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: cslists/caml To: Luca Pascali Cc: caml-list@inria.fr Subject: Re: [Caml-list] Native executable symtable In-reply-to: Your message of "Thu, 11 Nov 2004 12:09:06 +0100." <41934852.8020102@yahoo.it> Mime-Version: 1.0 Content-Type: text/plain Date: Thu, 11 Nov 2004 11:55:28 +0000 From: Keith Wansbrough Message-Id: X-Miltered: at nez-perce with ID 41935332.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41935331.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 symtable:01 bytecode:01 bytecode:01 compiler:01 compilation:01 ocaml:01 signatures:01 signatures:01 executables:01 modules:01 native:02 native:02 toc:02 module:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: > 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? The brute-force way is to make sure that you know one of the values in the table (the CRC of an unchanging module, say), and then just scan through the executable searching for that value as a bit-pattern. Once you find it, scan back until you find the CRC header, and you're done. Ugly, but it will work on pretty much any platform (unless the executable is compressed or encrypted). --KW 8-)