caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Yann Régis-Gianas" <yann.regisgianas@gmail.com>
To: "Pierre-Etienne Meunier" <pierreetienne.meunier@ens-lyon.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Bytecode object files structure
Date: Mon, 13 Nov 2006 10:16:40 +0100	[thread overview]
Message-ID: <1af89fca0611130116u1b6e4592q63fa24769ef5dac8@mail.gmail.com> (raw)
In-Reply-To: <200611121542.30370.pierreetienne.meunier@ens-lyon.fr>

Hi,

The file tools/dumpobj.ml in the O'Caml tree may be used to parse the
object file. This should be a first step to understand the bytecode
file format.

Hope this help,

--
Yann Régis-Gianas



On 11/12/06, Pierre-Etienne Meunier <pierreetienne.meunier@ens-lyon.fr> wrote:
> Hi,
>
> I'm trying to decrypt .cmo files produced by simple programs, such as
> 1+1;;
> or
> print_string "string";;
> or
> List.length [1;2;3;4;5];;
>
> According to the source of Ocaml, there's something called the
> "cmo_magic_number", systematically written at the beginning of all .cmo
> files. Does it have a real function for executing the programs, or is it just
> a way to make sure the file contains ocaml bytecode ?
>
> Then, there's the address of what seems to be the last bytecode instruction.
> Then, the bytecode instructions, as documented in opcodes.ml.
>
> After that, I can't understand anything : there vaguely seems to be some
> information related to linking or so... What is the precise structure of this
> part ? Is there some kind of a bytecode assembler ?
>
> Thanks,
> P.E. Meunier (pierreetienne.meunier@ens-lyon.fr)
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


-- 
Yann


  parent reply	other threads:[~2006-11-13  9:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-12 14:42 Pierre-Etienne Meunier
2006-11-12 14:56 ` [Caml-list] " Alain Frisch
2006-11-13  9:16 ` Yann Régis-Gianas [this message]
     [not found] ` <968382EE-B8CB-452C-A86F-684879E33798@free.fr>
2006-11-13 11:36   ` Pierre-Etienne Meunier
2006-11-15 13:41 Xavier Clerc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1af89fca0611130116u1b6e4592q63fa24769ef5dac8@mail.gmail.com \
    --to=yann.regisgianas@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=pierreetienne.meunier@ens-lyon.fr \
    --cc=yann@regis-gianas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).