From: Jeff Law Date: Tue, 15 Aug 2000 15:25:50 +0000 (-0600) Subject: final.c (profile_function): Do not emit profile counters in the data section, if... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=980e2067790a3972283b3eab5923802ef92bc185;p=gcc.git 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 --- diff --git a/gcc/tm.texi b/gcc/tm.texi index 008ee50e0d1..6f714ad898c 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -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