Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Reading external references from cmo/cmx files
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-10-04 (20:42)
From: Stéphane Glondu <steph@g...>
Subject: Re: [Caml-list] Reading external references from cmo/cmx files
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 from
> that file?

There is ocamlobjinfo. But it seems to work only with bytecode objects

> 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 is a
> cycle).

You can use ocamlobjinfo on bytecode objects to get your sorted list.
The same order will likely work with native code objects.