diff options
Diffstat (limited to 'powerpc/TargetPrinter.ml')
-rw-r--r-- | powerpc/TargetPrinter.ml | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index 5c414b56..567b0598 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -128,8 +128,10 @@ module Linux_System : SYSTEM = variable_section ~sec:".rodata" i | Section_small_const i -> variable_section ~sec:".section .sdata2,\"a\",@progbits" i - | Section_string -> ".rodata" - | Section_literal -> ".section .rodata" + | Section_string sz -> + elf_mergeable_string_section sz ".section .rodata" + | Section_literal sz -> + elf_mergeable_literal_section sz ".section .rodata" | Section_jumptable -> ".text" | Section_user(s, wr, ex) -> sprintf ".section \"%s\",\"a%s%s\",@progbits" @@ -218,8 +220,8 @@ module Diab_System : SYSTEM = variable_section ~sec:".sdata" ~bss:".sbss" ~common:false i | Section_const _ -> ".text" | Section_small_const _ -> ".sdata2" - | Section_string -> ".text" - | Section_literal -> ".text" + | Section_string _ -> ".text" + | Section_literal _ -> ".text" | Section_jumptable -> ".text" | Section_user(s, wr, ex) -> sprintf ".section \"%s\",,%c" @@ -919,21 +921,20 @@ module Target (System : SYSTEM):TARGET = let print_fun_info = elf_print_fun_info let emit_constants oc lit = - if exists_constants () then begin - section oc lit; + if Hashtbl.length literal64_labels > 0 then begin + section oc (Sections.with_size 8 lit); fprintf oc " .balign 8\n"; - Hashtbl.iter (print_literal64 oc) literal64_labels; - Hashtbl.iter (print_literal32 oc) literal32_labels; + Hashtbl.iter (print_literal64 oc) literal64_labels + end; + if Hashtbl.length literal32_labels > 0 then begin + section oc (Sections.with_size 4 lit); + fprintf oc " .balign 4\n"; + Hashtbl.iter (print_literal32 oc) literal32_labels end; reset_literals () let print_optional_fun_info _ = () - let get_section_names name = - match C2C.atom_sections name with - | [t;l;j] -> (t, l, j) - | _ -> (Section_text, Section_literal, Section_jumptable) - let print_var_info = elf_print_var_info let print_comm_symb oc sz name align = |