diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-12-04 13:41:47 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-12-04 13:41:47 +0100 |
commit | a0ce43e04778660a6f0ec98e70d7b54c5c987fcb (patch) | |
tree | 87368fb5f722839314fcb359d42c8b06f25dc24d /debug | |
parent | 0ba8c3f06308f8f6a75abe4130972d2cb32a9abe (diff) | |
download | compcert-a0ce43e04778660a6f0ec98e70d7b54c5c987fcb.tar.gz compcert-a0ce43e04778660a6f0ec98e70d7b54c5c987fcb.zip |
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.
Diffstat (limited to 'debug')
-rw-r--r-- | debug/DwarfPrinter.ml | 1 |
1 files changed, 1 insertions, 0 deletions
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) |