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:09)
From: Luca Pascali <pasckosky2000@y...>
Subject: Re: [Caml-list] Native executable symtable
Nicolas Cannasse wrote:

> [...]
>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.
>Nicolas Cannasse

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?

Module Sys gives a mutable value that says if we are running under a 
toplevel or not (Sys.interactive), too bad there's not something that 
says us if we are using a bytecode compiled application or not.

A method can be looking for the TOC for knowing if the application is 
bytecode or native.
In case of bytecode file, the TOC says us where the CRCS are located 
into the file. But at which offset we can found those CRCS in the native 
code compiled?

Thanks in advance

Luca Pascali

Baretta DE&IT
A division of Baretta SRL

tel. 02 370 111 55
fax. 02 370 111 54

Our technology: