diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-12-15 14:34:57 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-12-15 14:34:57 +0100 |
commit | 0e40a5b6ae0997b11469fdeea702db4c7f878c17 (patch) | |
tree | 2822da4c9312f949d751dfb7142de6a758f3e432 | |
parent | d830772b1d61c638fe2197755a2b77f7321118a9 (diff) | |
download | compcert-0e40a5b6ae0997b11469fdeea702db4c7f878c17.tar.gz compcert-0e40a5b6ae0997b11469fdeea702db4c7f878c17.zip |
Print cfi_sections only if cfi is supported.
On older version of the binutils the cfi directives are not always
supported so we only print cfi_sections if the corresponding .ini
setting is set to true.
-rw-r--r-- | arm/TargetPrinter.ml | 2 | ||||
-rw-r--r-- | backend/PrintAsmaux.ml | 6 | ||||
-rw-r--r-- | ia32/TargetPrinter.ml | 2 | ||||
-rw-r--r-- | powerpc/TargetPrinter.ml | 6 |
4 files changed, 11 insertions, 5 deletions
diff --git a/arm/TargetPrinter.ml b/arm/TargetPrinter.ml index 9f2c66cf..22d41c4d 100644 --- a/arm/TargetPrinter.ml +++ b/arm/TargetPrinter.ml @@ -902,7 +902,7 @@ module Target (Opt: PRINTER_OPTIONS) : TARGET = fprintf oc " .%s\n" (if !Clflags.option_mthumb then "thumb" else "arm"); if !Clflags.option_g then begin section oc Section_text; - fprintf oc " .cfi_sections .debug_frame\n" + cfi_section oc end diff --git a/backend/PrintAsmaux.ml b/backend/PrintAsmaux.ml index 4a612c26..0ca5b8e0 100644 --- a/backend/PrintAsmaux.ml +++ b/backend/PrintAsmaux.ml @@ -129,6 +129,12 @@ let cfi_rel_offset = else (fun _ _ _ -> ()) +let cfi_section = + if Configuration.asm_supports_cfi then + (fun oc -> fprintf oc " .cfi_sections .debug_frame\n") + else + (fun _ -> ()) + (* Basic printing functions *) let coqint oc n = fprintf oc "%ld" (camlint_of_coqint n) diff --git a/ia32/TargetPrinter.ml b/ia32/TargetPrinter.ml index 4c436c45..5fec2a01 100644 --- a/ia32/TargetPrinter.ml +++ b/ia32/TargetPrinter.ml @@ -759,7 +759,7 @@ module Target(System: SYSTEM):TARGET = need_masks := false; if !Clflags.option_g then begin section oc Section_text; - fprintf oc " .cfi_sections .debug_frame\n" + cfi_section oc end let print_epilogue oc = diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index 24511887..3f12a829 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -151,9 +151,9 @@ module Linux_System : SYSTEM = let print_prologue oc = if !Clflags.option_g then begin - section oc Section_text; - fprintf oc " .cfi_sections .debug_frame\n" - end + section oc Section_text; + cfi_section oc + end let print_epilogue oc = if !Clflags.option_g then |