From a0ce43e04778660a6f0ec98e70d7b54c5c987fcb Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 4 Dec 2015 13:41:47 +0100 Subject: Sort strings in the debug_str section. In order to get deterministic output code we need to sort the strings in the debug_str section by their label. Fix 17727. --- debug/DwarfPrinter.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'debug') diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml index 7469c4af..ef44a2d5 100644 --- a/debug/DwarfPrinter.ml +++ b/debug/DwarfPrinter.ml @@ -658,6 +658,7 @@ module DwarfPrinter(Target: DWARF_TARGET): print_label oc line_start; list_opt s (fun () -> section oc Section_debug_str; + let s = List.sort (fun (a,_) (b,_) -> Pervasives.compare a b) s in List.iter (fun (id,s) -> print_label oc (loc_to_label id); fprintf oc " .asciz \"%s\"\n" s) s) -- cgit