Use PROFILE_HOOK to add mcount library calls in each toolchain.
gcc/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.h (FUNCTION_PROFILER): Redefine to empty.
* config/arc/elf.h (PROFILE_HOOK): Define.
* config/arc/linux.h (PROFILE_HOOK): Likewise.
From-SVN: r266068
+2018-11-13 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * config/arc/arc.h (FUNCTION_PROFILER): Redefine to empty.
+ * config/arc/elf.h (PROFILE_HOOK): Define.
+ * config/arc/linux.h (PROFILE_HOOK): Likewise.
+
2018-11-13 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (hwloop_optimize): Bailout when detecting a
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
(OFFSET) = arc_initial_elimination_offset ((FROM), (TO))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
-#define FUNCTION_PROFILER(FILE, LABELNO) \
- do { \
- if (flag_pic) \
- fprintf (FILE, "\tbl\t__mcount@plt\n"); \
- else \
- fprintf (FILE, "\tbl\t__mcount\n"); \
- } while (0)
+/* All the work done in PROFILE_HOOK, but still required. */
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(STREAM, LABELNO) do { } while (0)
#define NO_PROFILE_COUNTERS 1
#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC \
"--start-group %G %{!specs=*:%{!nolibc:-lc -lnosys}} --end-group"
+
+/* Emit rtl for profiling. Output assembler code to FILE
+ to call "_mcount" for profiling a function entry. */
+#define PROFILE_HOOK(LABEL) \
+ { \
+ rtx fun; \
+ fun = gen_rtx_SYMBOL_REF (Pmode, "__mcount"); \
+ emit_library_call (fun, LCT_NORMAL, VOIDmode); \
+ }
: "=r" (_beg) \
: "0" (_beg), "r" (_end), "r" (_xtr), "r" (_scno)); \
}
+
+/* Emit rtl for profiling. Output assembler code to FILE
+ to call "_mcount" for profiling a function entry. */
+#define PROFILE_HOOK(LABEL) \
+ { \
+ rtx fun, rt; \
+ rt = get_hard_reg_initial_val (Pmode, RETURN_ADDR_REGNUM); \
+ fun = gen_rtx_SYMBOL_REF (Pmode, "_mcount"); \
+ emit_library_call (fun, LCT_NORMAL, VOIDmode, rt, Pmode); \
+ }