summaryrefslogtreecommitdiff
path: root/checklink/Check.ml
diff options
context:
space:
mode:
authorGravatar varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-04-12 11:31:33 +0000
committerGravatar varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-04-12 11:31:33 +0000
commit23b04dd211287eb1c841c129705af39afbe0ab15 (patch)
treedb4bc3790673d93b5b16897c387d2c0083de871d /checklink/Check.ml
parent547d8ecb50541db1e80bb23d065e55046a27452e (diff)
Faster ndxes_of_sym_name
ndxes_of_sym_name used to have an O(s^2) complexity where s was the number of symbols in the ELF file. It has now been reduced to an O(s*ln(s)) by pre-computing the sets of symbols corresponding to each normalized symbol name. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1875 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'checklink/Check.ml')
-rw-r--r--checklink/Check.ml17
1 files changed, 16 insertions, 1 deletions
diff --git a/checklink/Check.ml b/checklink/Check.ml
index 3559980..dc010a3 100644
--- a/checklink/Check.ml
+++ b/checklink/Check.ml
@@ -2749,7 +2749,9 @@ let read_sdump file =
(** Processes a .sdump file.
*)
let process_sdump efw sdump: e_framework =
+ if !debug then print_endline ("Beginning reading " ^ sdump);
let (prog, names, atoms) = read_sdump sdump in
+ if !debug then print_endline "Constructing mapping from idents to symbol indices";
let ident_to_sym_ndx =
Hashtbl.fold
(fun ident name m ->
@@ -2760,6 +2762,7 @@ let process_sdump efw sdump: e_framework =
names
PosMap.empty
in
+ if !debug then print_endline "Constructing worklist";
let worklist_fundefs =
List.filter
(fun f ->
@@ -2778,6 +2781,7 @@ let process_sdump efw sdump: e_framework =
)
worklist_fundefs
in
+ if !debug then print_endline "Beginning processing of the worklist";
efw
>>> (fun efw ->
{
@@ -2790,7 +2794,15 @@ let process_sdump efw sdump: e_framework =
}
)
>>> worklist_process wl
+ >>> (fun sfw ->
+ if !debug then print_endline "Checking stubs";
+ sfw
+ )
>>> check_stubs
+ >>> (fun sfw ->
+ if !debug then print_endline "Checking data";
+ sfw
+ )
>>> check_data prog.prog_vars
>>> (fun sfw -> sfw.ef)
@@ -3023,6 +3035,7 @@ let check_elf_nodump elf sdumps =
ELF_symbol_strtab
>>> check_sym_tab_zero
in
+ if !debug then print_endline "Done checking header, beginning processing of .sdumps";
(* Thread the framework through the processing of all .sdump files *)
List.fold_left process_sdump efw sdumps
(* then finally, check the padding in between identified byte chunks *)
@@ -3032,7 +3045,9 @@ let check_elf_nodump elf sdumps =
If requested, dump the calculated bytes mapping, so that it can be
reused by the fuzzer. *)
let check_elf_dump elffilename sdumps =
+ if !debug then print_endline "Beginning ELF parsing";
let elf = read_elf elffilename in
+ if !debug then print_endline "Beginning ELF checking";
let efw = check_elf_nodump elf sdumps in
(* print the elfmap if requested *)
if !print_elfmap then begin
@@ -3137,4 +3152,4 @@ let check_elf_dump elffilename sdumps =
)
(rev efw.log)
)
- end;
+ end