English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Native executable symtable
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-11-11 (11:55)
From: Keith Wansbrough <Keith.Wansbrough@c...>
Subject: Re: [Caml-list] Native executable symtable
> 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-)