@@ -107,6 +107,14 @@ let export_directory = ref ""
107107let savecfgs = ref false
108108let save_xml = ref false (* save disassembly status in xml *)
109109let save_asm = ref false
110+
111+ let print_datasections = ref []
112+ let add_print_datasection (s : string ) =
113+ if List. mem s ! print_datasections then
114+ ()
115+ else
116+ print_datasections := s :: ! print_datasections
117+
110118let save_asm_cfg_info = ref false (* save functions list with cfg info in xml *)
111119let set_datablocks = ref false (* only supported for arm *)
112120let construct_all_functions = ref false
@@ -210,6 +218,8 @@ let speclist =
210218 " save assembly listing in the analysis directory" );
211219 (" -save_asm_cfg_info" , Arg. Unit (fun () -> save_asm_cfg_info := true ),
212220 " save list of functions with cfg info to xml file (may be slow)" );
221+ (" -print_datasection" , Arg. String (fun s -> add_print_datasection s),
222+ " print the data sections as part of the assembly listing" );
213223 (" -construct_all_functions" ,
214224 Arg. Unit (fun () -> construct_all_functions := true ),
215225 " construct all functions even if analyzing only a few of them" );
@@ -579,13 +589,13 @@ let main () =
579589 *)
580590 begin
581591 if ! save_asm then
592+ let datarefs = get_arm_data_references () in
582593 begin
583- let datarefs = get_arm_data_references () in
584594 file_output#saveFile
585595 (get_asm_listing_filename () )
586596 (let instrs = ! BCHARMAssemblyInstructions. arm_assembly_instructions in
587597 (LBLOCK [
588- STR (instrs#toString ~datarefs () );
598+ STR (instrs#toString ~datarefs ~datasections: ! print_datasections () );
589599 arm_callsites_records#toPretty;
590600 arm_callsites_records#summary_to_pretty]));
591601 pr_timing [STR " assembly listing saved" ];
0 commit comments