From 0437f97dbcf4e8a1a6e55ccb249e754dbd565e00 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Tue, 21 Nov 2017 17:31:17 +0000 Subject: Expose entry point in elf_loader for Sail model --- lib/ocaml_rts/elf_loader.ml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3