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=none autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 78466BBAF for ; Sat, 4 Oct 2008 22:42:08 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhUDAH9x50iK54gDiGdsb2JhbACTYgEBARUipSOBaA X-IronPort-AV: E=Sophos;i="4.33,361,1220220000"; d="scan'208";a="29906276" Received: from rouge.crans.org ([138.231.136.3]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 04 Oct 2008 22:42:08 +0200 Received: from localhost (localhost.crans.org [127.0.0.1]) by rouge.crans.org (Postfix) with ESMTP id F4089837E; Sat, 4 Oct 2008 22:42:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at crans.org Received: from rouge.crans.org ([10.231.136.3]) by localhost (rouge.crans.org [10.231.136.3]) (amavisd-new, port 10024) with LMTP id ztaMPAIIQXV3; Sat, 4 Oct 2008 22:42:06 +0200 (CEST) Received: from [88.185.141.188] (korell.glondu.net [88.185.141.188]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rouge.crans.org (Postfix) with ESMTP id 9D223808D; Sat, 4 Oct 2008 22:42:06 +0200 (CEST) Message-ID: <48E7D514.4070502@glondu.net> Date: Sat, 04 Oct 2008 22:41:56 +0200 From: =?UTF-8?B?U3TDqXBoYW5lIEdsb25kdQ==?= User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Jason Noakes Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Reading external references from cmo/cmx files References: <2738.192.168.2.3.1223151615.squirrel@192.168.2.5> In-Reply-To: <2738.192.168.2.3.1223151615.squirrel@192.168.2.5> X-Enigmail-Version: 0.95.0 OpenPGP: id=FCE03DAA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; cmo:01 cmx:01 cmo:01 cmx:01 bytecode:01 bytecode:01 cheers:01 phane:98 steph:98 phane:98 wrote:01 caml-list:01 cma:01 modules:02 referenced:02 Jason Noakes wrote: > Are there any tools or examples that would allow me to take a .cmo or .= cmx > file and produce a list of the external modules that are referenced fro= m > that file? There is ocamlobjinfo. But it seems to work only with bytecode objects (.cmo/.cma). > If I could just read a list of external module references out of a .cmo= > file I could topologically sort them on my own (or error out if there i= s a > cycle). You can use ocamlobjinfo on bytecode objects to get your sorted list. The same order will likely work with native code objects. Cheers, --=20 St=C3=A9phane