aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/TargetPrinter.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-10-13 16:23:20 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-10-13 16:23:20 +0200
commita479c280441b91007c379b0b63b907926d54f930 (patch)
tree830342b8c8ed25a9c16aacac0aedc8aa477c2431 /powerpc/TargetPrinter.ml
parent16315711d815580afa77f93424cc49c7362ab5b8 (diff)
downloadcompcert-kvx-a479c280441b91007c379b0b63b907926d54f930.tar.gz
compcert-kvx-a479c280441b91007c379b0b63b907926d54f930.zip
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.
Diffstat (limited to 'powerpc/TargetPrinter.ml')
-rw-r--r--powerpc/TargetPrinter.ml16
1 files changed, 11 insertions, 5 deletions
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";