diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-04-10 20:55:44 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-04-10 20:55:44 +0200 |
commit | 50d59f7ab7ae06de2ae6439752f0b56695d539df (patch) | |
tree | d625542a64dff9eeabc07678ad82cd21ade585b8 /aarch64 | |
parent | b19b9defebf96ba8599f481d4c617d43c21642ef (diff) | |
download | compcert-kvx-50d59f7ab7ae06de2ae6439752f0b56695d539df.tar.gz compcert-kvx-50d59f7ab7ae06de2ae6439752f0b56695d539df.zip |
fix writing profiling info for Aarch64
Diffstat (limited to 'aarch64')
-rw-r--r-- | aarch64/TargetPrinter.ml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/aarch64/TargetPrinter.ml b/aarch64/TargetPrinter.ml index 9d605336..5f62c936 100644 --- a/aarch64/TargetPrinter.ml +++ b/aarch64/TargetPrinter.ml @@ -608,9 +608,15 @@ module Target : TARGET = fprintf oc " add x1, x1, :lo12:%s\n" profiling_id_table_name; fprintf oc " mov w0, %d\n" nr_items; fprintf oc " b %s\n" profiling_write_table_helper ;; + + let print_atexit oc to_be_called = + fprintf oc " adrp x0, %s\n" to_be_called; + fprintf oc " add x0, x0, :lo12:%s\n" to_be_called; + fprintf oc " b atexit\n";; + let print_epilogue oc = - print_profiling fini_section aarch64_profiling_stub oc; + print_profiling_epilogue (Init_atexit print_atexit) aarch64_profiling_stub oc; if !Clflags.option_g then begin Debug.compute_gnu_file_enum (fun f -> ignore (print_file oc f)); section oc Section_text; |