]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/ocaml/contrib/bytecomp/cmo_format.mli
Update
[l4.git] / l4 / pkg / ocaml / ocaml / contrib / bytecomp / cmo_format.mli
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                           Objective Caml                            *)
4 (*                                                                     *)
5 (*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
6 (*                                                                     *)
7 (*  Copyright 2006 Institut National de Recherche en Informatique et   *)
8 (*  en Automatique.  All rights reserved.  This file is distributed    *)
9 (*  under the terms of the Q Public License version 1.0.               *)
10 (*                                                                     *)
11 (***********************************************************************)
12
13 (* $Id: cmo_format.mli 7422 2006-05-11 15:50:53Z xleroy $ *)
14
15 (* Symbol table information for .cmo and .cma files *)
16
17 (* Relocation information *)
18
19 type reloc_info =
20     Reloc_literal of Lambda.structured_constant    (* structured constant *)
21   | Reloc_getglobal of Ident.t              (* reference to a global *)
22   | Reloc_setglobal of Ident.t              (* definition of a global *)
23   | Reloc_primitive of string               (* C primitive number *)
24
25 (* Descriptor for compilation units *)
26
27 type compilation_unit =
28   { cu_name: string;                    (* Name of compilation unit *)
29     mutable cu_pos: int;                (* Absolute position in file *)
30     cu_codesize: int;                   (* Size of code block *)
31     cu_reloc: (reloc_info * int) list;  (* Relocation information *)
32     cu_imports: (string * Digest.t) list; (* Names and CRC of intfs imported *)
33     cu_primitives: string list;         (* Primitives declared inside *)
34     mutable cu_force_link: bool;        (* Must be linked even if unref'ed *)
35     mutable cu_debug: int;              (* Position of debugging info, or 0 *)
36     cu_debugsize: int }                 (* Length of debugging info *)
37
38 (* Format of a .cmo file:
39      magic number (Config.cmo_magic_number)
40      absolute offset of compilation unit descriptor
41      block of relocatable bytecode
42      debugging information if any
43      compilation unit descriptor *)
44
45 (* Descriptor for libraries *)
46
47 type library =
48   { lib_units: compilation_unit list;   (* List of compilation units *)
49     lib_custom: bool;                   (* Requires custom mode linking? *)
50     lib_ccobjs: string list;            (* C object files needed for -custom *)
51     lib_ccopts: string list;            (* Extra opts to C compiler *)
52     lib_dllibs: string list }           (* DLLs needed *)
53
54 (* Format of a .cma file:
55      magic number (Config.cma_magic_number)
56      absolute offset of library descriptor
57      object code for first library member
58      ...
59      object code for last library member
60      library descriptor *)
61