FUNCTION_PROFILER/mcount fixes for FreeBSD

David O'Brien obrien@NUXI.com
Tue Jun 15 18:08:00 GMT 1999


Here is a patch to fix the mcount useage in FUNCTION_PROFILER.

-- 
-- David    (obrien@NUXI.com  -or-  obrien@FreeBSD.org)


Tue Jun 15 00:52:34 1999  David O'Brien <obrien@FreeBSD.org>

	* i386/freebsd-elf.h (FUNCTION_PROFILER): labels are not needed and
	the reference to `mcount' was not correct for the ELF on FreeBSD.


diff -ru egcs-19990608/gcc/config/i386/freebsd-elf.h egcs-19990608.new/gcc/config/i386/freebsd-elf.h
--- egcs-19990608/gcc/config/i386/freebsd-elf.h	Thu Jun  3 16:18:41 1999
+++ egcs-19990608.new/gcc/config/i386/freebsd-elf.h	Tue Jun 15 09:18:33 1999
@@ -135,23 +135,15 @@
  : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
  : (-1))
 
-/* Output assembler code to FILE to increment profiler label # LABELNO
-   for profiling a function entry.  */
+/* Tell final.c that we don't need a label passed to mcount.  */
 
 #undef FUNCTION_PROFILER
 #define FUNCTION_PROFILER(FILE, LABELNO)  \
 {									\
   if (flag_pic)								\
-    {									\
-      fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n",		\
-	       LPREFIX, (LABELNO));					\
-      fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n");			\
-    }									\
+      fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n");			\
   else									\
-    {									\
-      fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO));	\
-      fprintf (FILE, "\tcall mcount\n");				\
-    }									\
+      fprintf (FILE, "\tcall .mcount\n");				\
 }
 
 #undef SIZE_TYPE


More information about the Gcc-patches mailing list