1 (***********************************************************************)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
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. *)
11 (***********************************************************************)
13 (* $Id: cmo_format.mli 7422 2006-05-11 15:50:53Z xleroy $ *)
15 (* Symbol table information for .cmo and .cma files *)
17 (* Relocation information *)
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 *)
25 (* Descriptor for compilation units *)
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 *)
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 *)
45 (* Descriptor for libraries *)
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 *)
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
59 object code for last library member