summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-11-21 17:31:17 +0000
committerAlasdair Armstrong2017-11-21 17:31:17 +0000
commit0437f97dbcf4e8a1a6e55ccb249e754dbd565e00 (patch)
treea0da6b00323666fcdb82d66cf2545fa9fef75cd1 /lib
parent97cf53759eab27d3c3ac7df95bf1370707609dc4 (diff)
Expose entry point in elf_loader for Sail model
Diffstat (limited to 'lib')
-rw-r--r--lib/ocaml_rts/elf_loader.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ocaml_rts/elf_loader.ml b/lib/ocaml_rts/elf_loader.ml
index ab49c57b..b5ecce24 100644
--- a/lib/ocaml_rts/elf_loader.ml
+++ b/lib/ocaml_rts/elf_loader.ml
@@ -45,6 +45,7 @@ open Big_int
let opt_file_arguments = ref ([] : string list)
let opt_elf_threads = ref 1
+let opt_elf_entry = ref zero_big_int
let options = Arg.align []
@@ -125,5 +126,10 @@ let load_elf () =
match !opt_file_arguments with
| (name :: _) ->
let segments, e_entry = read name in
+ opt_elf_entry := e_entry;
List.iter load_segment segments
| [] -> ()
+
+(* The sail model can access this by externing a unit -> int function
+ as Elf_loader.elf_entry. *)
+let elf_entry () = !opt_elf_entry