From a479c280441b91007c379b0b63b907926d54f930 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 13 Oct 2015 16:23:20 +0200 Subject: Changed the type of the debug sections with additional string. Instead of using a string they now take an optional string, which should be none if the backend is not the diab backend and the corresponding section is the text section and Some s with s being the custom section name else. Bug 17392. --- powerpc/TargetPrinter.ml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'powerpc/TargetPrinter.ml') diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index 61ac5e42..a596e587 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -218,20 +218,25 @@ module Diab_System : SYSTEM = | true, false -> 'd' (* data *) | false, true -> 'c' (* text *) | false, false -> 'r') (* const *) - | Section_debug_info s -> sprintf ".section .debug_info%s,,n" (if s <> ".text" then s else "") + | Section_debug_info (Some s) -> + sprintf ".section .debug_info%s,,n" s + | Section_debug_info None -> + sprintf ".section .debug_info,,n" | 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_line (Some s) -> + sprintf ".section .debug_line.%s,,n\n" s + | Section_debug_line None -> + sprintf ".section .debug_line,,n\n" | Section_debug_str -> assert false (* Should not be used *) let section oc sec = let name = name_of_section sec in assert (name <> "COMM"); match sec with - | Section_debug_info s -> + | Section_debug_info (Some s) -> fprintf oc " %s\n" name; - if s <> ".text" then - fprintf oc " .sectionlink .debug_info\n" + fprintf oc " .sectionlink .debug_info\n" | _ -> fprintf oc " %s\n" name @@ -263,6 +268,7 @@ module Diab_System : SYSTEM = Debug.add_diab_info name (line_start,debug_info,name_of_section sec); Debug.add_compilation_section_start name low_pc; let line_name = ".debug_line" ^(if name <> ".text" then name else "") in + section oc (Section_debug_line (if name <> ".text" then Some name else None)); fprintf oc " .section %s,,n\n" line_name; if name <> ".text" then fprintf oc " .sectionlink .debug_line\n"; -- cgit