Call mcount for profiling.

This commit is contained in:
tsubai 2000-08-22 11:24:41 +00:00
parent fa2f94238c
commit 84ecfb5e88
2 changed files with 25 additions and 0 deletions

View File

@ -89,3 +89,15 @@
and initialization stuff better. */
#undef DWARF2_UNWIND_INFO
/* XXX shouldn't use "1f"-style labels */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(STREAM,LABELNO) \
{ \
fprintf((STREAM), "\tmov.l\t11f,r1\n"); \
fprintf((STREAM), "\tmova\t12f,r0\n"); \
fprintf((STREAM), "\tjmp\t@r1\n"); \
fprintf((STREAM), "\tnop\n"); \
fprintf((STREAM), "\t.align\t2\n"); \
fprintf((STREAM), "11:\t.long\t__mcount\n"); \
fprintf((STREAM), "12:\n"); \
}

View File

@ -128,3 +128,16 @@ do { \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
%{static:-static}}"
/* XXX shouldn't use "1f"-style labels */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(STREAM,LABELNO) \
{ \
fprintf((STREAM), "\tmov.l\t11f,r1\n"); \
fprintf((STREAM), "\tmova\t12f,r0\n"); \
fprintf((STREAM), "\tjmp\t@r1\n"); \
fprintf((STREAM), "\tnop\n"); \
fprintf((STREAM), "\t.align\t2\n"); \
fprintf((STREAM), "11:\t.long\t__mcount\n"); \
fprintf((STREAM), "12:\n"); \
}