Commit 980e2067 by Jeff Law

final.c (profile_function): Do not emit profile counters in the data section, if…

final.c (profile_function): Do not emit profile counters in the data section, if NO_PROFILE_COUNTERS is defined.

        * final.c (profile_function): Do not emit profile counters in
        the data section, if NO_PROFILE_COUNTERS is defined.
        * tm.texi: Document NO_PROFILE_COUNTERS.  Update doc for
        FUNCTION_PROFILER.

        * config/i386/linux.h (NO_PROFILE_COUNTERS): Define.
        (FUNCTION_PROFILER): Just emit a call to mcount.
Restoring tm.texi after corruption.

From-SVN: r35709
parent f99fce0c
......@@ -3502,18 +3502,24 @@ These macros will help you generate code for profiling.
@item FUNCTION_PROFILER (@var{file}, @var{labelno})
A C statement or compound statement to output to @var{file} some
assembler code to call the profiling subroutine @code{mcount}.
Before calling, the assembler code must load the address of a
counter variable into a register where @code{mcount} expects to
find the address. The name of this variable is @samp{LP} followed
by the number @var{labelno}, so you would generate the name using
@samp{LP%d} in a @code{fprintf}.
@findex mcount
The details of how the address should be passed to @code{mcount} are
determined by your operating system environment, not by GCC. To
figure them out, compile a small program for profiling using the
system's installed C compiler and look at the assembler code that
results.
The details of how @code{mcount} expects to be called are determined by
your operating system environment, not by GCC. To figure them out,
compile a small program for profiling using the system's installed C
compiler and look at the assembler code that results.
Older implementations of @code{mcount} expect the address of a counter
variable to be loaded into some register. The name of this variable is
@samp{LP} followed by the number @var{labelno}, so you would generate
the name using @samp{LP%d} in a @code{fprintf}.
@findex NO_PROFILE_COUNTERS
@item NO_PROFILE_COUNTERS
Define this macro if the @code{mcount} subroutine on your system does
not need a counter variable allocated for each function. This is true
for almost all modern implementations. If you define this macro, you
must not use the @var{labelno} argument to @code{FUNCTION_PROFILER}.
@findex PROFILE_BEFORE_PROLOGUE
@item PROFILE_BEFORE_PROLOGUE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment