diff options
Diffstat (limited to 'powerpc/PrintAsm.ml')
-rw-r--r-- | powerpc/PrintAsm.ml | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/powerpc/PrintAsm.ml b/powerpc/PrintAsm.ml index 0c4356ec..77eb2378 100644 --- a/powerpc/PrintAsm.ml +++ b/powerpc/PrintAsm.ml @@ -37,6 +37,9 @@ module type SYSTEM = val cfi_adjust: out_channel -> int32 -> unit val cfi_rel_offset: out_channel -> string -> int32 -> unit val print_prologue: out_channel -> unit + (* val print_epilogue: out_channel -> unit *) + (* val print_addr_label: out_channel -> int -> unit *) + (* val set_compilation_unit_addrs: int -> int -> unit *) end let symbol oc symb = @@ -118,6 +121,8 @@ module Linux_System : SYSTEM = | Section_user(s, wr, ex) -> sprintf ".section \"%s\",\"a%s%s\",@progbits" s (if wr then "w" else "") (if ex then "x" else "") + | Section_debug -> sprintf ".section .debug_info,\"\",@progbits" + | Section_debug_abbrev -> sprintf ".section .debug_abbrev,\"\",@progbits" let print_file_line oc file line = PrintAnnot.print_file_line oc comment file line @@ -200,9 +205,11 @@ module Diab_System : SYSTEM = | true, false -> 'd' (* data *) | false, true -> 'c' (* text *) | false, false -> 'r') (* const *) + | Section_debug -> ".section .debug_info,,n" + | Section_debug_abbrev -> ".section .debug_abbrev,,n" let print_file_line oc file line = - PrintAnnot.print_file_line_d1 oc comment file line + PrintAnnot.print_file_line_d2 oc comment file line (* Emit .cfi directives *) let cfi_startproc oc = () @@ -222,7 +229,7 @@ module Diab_System : SYSTEM = module AsmPrinter (Target : SYSTEM) = struct - open Target + include Target (* On-the-fly label renaming *) @@ -839,11 +846,10 @@ let print_program oc p = let module Target = (val (match target with | Linux -> (module Linux_System:SYSTEM) | Diab -> (module Diab_System:SYSTEM)):SYSTEM) in - PrintAnnot.reset_filenames(); - PrintAnnot.print_version_and_options oc Target.comment; let module Printer = AsmPrinter(Target) in - Target.print_prologue oc; + (* Printer.set_compilation_unit_addrs 1 2; (\* TODO This is dummy code *\) *) + PrintAnnot.reset_filenames(); + PrintAnnot.print_version_and_options oc Printer.comment; + Printer.print_prologue oc; List.iter (Printer.print_globdef oc) p.prog_defs; - PrintAnnot.close_filenames() - - + (* Printer.print_epilogue oc *) |