From 16315711d815580afa77f93424cc49c7362ab5b8 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 13 Oct 2015 14:57:31 +0200 Subject: Implement the usage of the debug_str section for the gcc backend. GCC prints all string larger than 3 characters in the debug_str section which reduces the size of the debug information since entries containing the same string now map to the same string in the debug_str sections. Bug 17392. --- powerpc/AsmToJSON.ml | 3 ++- powerpc/TargetPrinter.ml | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'powerpc') diff --git a/powerpc/AsmToJSON.ml b/powerpc/AsmToJSON.ml index 9d480ed5..7c52bb40 100644 --- a/powerpc/AsmToJSON.ml +++ b/powerpc/AsmToJSON.ml @@ -341,7 +341,8 @@ let p_section oc = function | Section_debug_info _ | Section_debug_abbrev | Section_debug_line _ - | Section_debug_loc -> () (* There should be no info in the debug sections *) + | Section_debug_loc + | Section_debug_str -> () (* There should be no info in the debug sections *) let p_int_opt oc = function | None -> fprintf oc "0" diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index 250686be..61ac5e42 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -126,7 +126,8 @@ module Linux_System : SYSTEM = | Section_debug_info _ -> ".section .debug_info,\"\",@progbits" | Section_debug_abbrev -> ".section .debug_abbrev,\"\",@progbits" | Section_debug_loc -> ".section .debug_loc,\"\",@progbits" - | Section_debug_line _ -> ".section .debug_line,\"\",@progbits\n" + | Section_debug_line _ -> ".section .debug_line,\"\",@progbits" + | Section_debug_str -> ".section .debug_str,\"MS\",@progbits,1" let section oc sec = @@ -221,6 +222,7 @@ module Diab_System : SYSTEM = | Section_debug_abbrev -> ".section .debug_abbrev,,n" | Section_debug_loc -> ".section .debug_loc,,n" | Section_debug_line s -> sprintf ".section .debug_line.%s,,n\n" s + | Section_debug_str -> assert false (* Should not be used *) let section oc sec = let name = name_of_section sec in -- cgit