-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaout.mli
91 lines (71 loc) · 2.45 KB
/
aout.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
(*
Atari Jaguar Removers' Linker
Copyright (C) 2014-2017 Seb/The Removers ([email protected])
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*)
type machine = M68000 | M68010 | M68020
type magic = OMAGIC
type section = Absolute | Text | Data | Bss
type location = Local | External
type stab_type =
| SO (* name of source file name *)
| SOL (* name of sub-source file *)
| SLINE (* line number in text segment *)
| OPT (* options for the debugger *)
| LSYM (* automatic variable in the stack *)
| BNSYM (* beginning of a relocatable function block *)
| FUN (* function name or text-segment variable *)
| PSYM (* parameter variable *)
| LBRAC (* beginning of lexical block *)
| RBRAC (* end of lexical block *)
| RSYM (* register variable *)
| STSYM (* data-segment variable with internal linkage *)
| GSYM (* global variable *)
| LCSYM
(* BSS-segment variable with internal linkage *)
type symbol_type = Undefined | Type of location * section | Stab of stab_type
type symbol = {
name : string;
typ : symbol_type;
other : int;
desc : int;
value : Int32.t;
}
type size = Byte | Word | Long
type reloc_base = Symbol of int | Section of section
type reloc_info = {
reloc_address : int;
reloc_base : reloc_base;
pcrel : bool;
size : size;
baserel : bool;
jmptable : bool;
relative : bool;
copy : bool;
}
type object_params = {
filename : string;
machine : machine;
magic : magic;
text : string;
data : string;
bss_size : int;
entry : Int32.t;
text_reloc : reloc_info list;
data_reloc : reloc_info list;
symbols : symbol array;
}
val section_of_type : symbol_type -> section
val build_index : symbol array -> (string, int) Hashtbl.t
val load_object : filename:string -> string -> object_params option
val data_object : filename:string -> symbol:string -> string -> object_params
val save_object : string -> object_params -> unit