Browse Source

cleanup CALL_MCOUNT / PROF

As this is only implemented for a few architecture and not well
tested, just remove it.
Waldemar Brodkorb 7 years ago
parent
commit
345181fb9a

+ 1 - 12
libc/sysdeps/linux/arm/sysdep.h

@@ -67,23 +67,12 @@
   .globl C_SYMBOL_NAME(name);			\
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function)		\
   .align ALIGNARG(4);						\
-  name##:							\
-  CALL_MCOUNT
+  name##:
 
 #undef	END
 #define END(name)						\
   ASM_SIZE_DIRECTIVE(name)
 
-/* If compiled for profiling, call `mcount' at the start of each function.  */
-#ifdef	PROF
-#define CALL_MCOUNT			\
-	str	lr,[sp, #-4]!	;	\
-	bl	PLTJMP(mcount)	;	\
-	ldr	lr, [sp], #4	;
-#else
-#define CALL_MCOUNT		/* Do nothing.  */
-#endif
-
 #ifdef	NO_UNDERSCORES
 /* Since C identifiers are not normally prefixed with an underscore
    on this system, the asm identifier `syscall_error' intrudes on the

+ 1 - 14
libc/sysdeps/linux/i386/sysdep.h

@@ -47,26 +47,13 @@
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
   .align ALIGNARG(4);							      \
   C_LABEL(name)								      \
-  cfi_startproc;							      \
-  CALL_MCOUNT
+  cfi_startproc;
 
 #undef	END
 #define END(name)							      \
   cfi_endproc;								      \
   ASM_SIZE_DIRECTIVE(name)						      \
 
-/* If compiled for profiling, call `mcount' at the start of each function.  */
-#ifdef	PROF
-/* The mcount code relies on a normal frame pointer being on the stack
-   to locate our caller, so push one just for its benefit.  */
-#define CALL_MCOUNT \
-  pushl %ebp; cfi_adjust_cfa_offset (4); movl %esp, %ebp; \
-  cfi_def_cfa_register (ebp); call JUMPTARGET(mcount); \
-  popl %ebp; cfi_def_cfa (esp, 4);
-#else
-#define CALL_MCOUNT		/* Do nothing.  */
-#endif
-
 #ifdef	NO_UNDERSCORES
 /* Since C identifiers are not normally prefixed with an underscore
    on this system, the asm identifier `syscall_error' intrudes on the

+ 2 - 6
libc/sysdeps/linux/ia64/sysdep.h

@@ -39,15 +39,12 @@
 #define C_LABEL(name)		name/**/:
 #endif
 
-#define CALL_MCOUNT
-
 #define ENTRY(name)				\
 	.text;					\
 	.align 32;				\
 	.proc C_SYMBOL_NAME(name);		\
 	.global C_SYMBOL_NAME(name);		\
-	C_LABEL(name)				\
-	CALL_MCOUNT
+	C_LABEL(name)
 
 #define HIDDEN_ENTRY(name)			\
 	.text;					\
@@ -55,8 +52,7 @@
 	.proc C_SYMBOL_NAME(name);		\
 	.global C_SYMBOL_NAME(name);		\
 	.hidden C_SYMBOL_NAME(name);		\
-	C_LABEL(name)				\
-	CALL_MCOUNT
+	C_LABEL(name)
 
 #define LEAF(name)				\
   .text;					\

+ 1 - 22
libc/sysdeps/linux/sh/sysdep.h

@@ -42,34 +42,13 @@
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function)			      \
   .align ALIGNARG(5);							      \
   C_LABEL(name)								      \
-  cfi_startproc;							      \
-  CALL_MCOUNT
+  cfi_startproc;
 
 #undef	END
 #define END(name)							      \
   cfi_endproc;								      \
   ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
 
-/* If compiled for profiling, call `mcount' at the start of each function.  */
-#ifdef	PROF
-#define CALL_MCOUNT					\
-	mov.l	1f,r1;					\
-	sts.l	pr,@-r15;				\
-	cfi_adjust_cfa_offset (4);			\
-	cfi_rel_offset (pr, 0);				\
-	mova	2f,r0;					\
-	jmp	@r1;					\
-	 lds	r0,pr;					\
-	.align	2;					\
-1:	.long	mcount;					\
-2:	lds.l	@r15+,pr;				\
-	cfi_adjust_cfa_offset (-4);			\
-	cfi_restore (pr)
-
-#else
-#define CALL_MCOUNT		/* Do nothing.  */
-#endif
-
 #ifdef	__UCLIBC_UNDERSCORES__
 /* Since C identifiers are not normally prefixed with an underscore
    on this system, the asm identifier `syscall_error' intrudes on the

+ 1 - 18
libc/sysdeps/linux/x86_64/sysdep.h

@@ -42,30 +42,13 @@
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
   .align ALIGNARG(4);							      \
   C_LABEL(name)								      \
-  cfi_startproc;							      \
-  CALL_MCOUNT
+  cfi_startproc;
 
 #undef	END
 #define END(name)							      \
   cfi_endproc;								      \
   ASM_SIZE_DIRECTIVE(name)
 
-/* If compiled for profiling, call `mcount' at the start of each function.  */
-#ifdef	PROF
-/* The mcount code relies on a normal frame pointer being on the stack
-   to locate our caller, so push one just for its benefit.  */
-#define CALL_MCOUNT                                                          \
-  pushq %rbp;                                                                \
-  cfi_adjust_cfa_offset(8);                                                  \
-  movq %rsp, %rbp;                                                           \
-  cfi_def_cfa_register(%rbp);                                                \
-  call JUMPTARGET(mcount);                                                   \
-  popq %rbp;                                                                 \
-  cfi_def_cfa(rsp,8);
-#else
-#define CALL_MCOUNT		/* Do nothing.  */
-#endif
-
 #ifdef	NO_UNDERSCORES
 /* Since C identifiers are not normally prefixed with an underscore
    on this system, the asm identifier `syscall_error' intrudes on the

+ 2 - 6
libc/sysdeps/linux/xtensa/sysdep.h

@@ -45,8 +45,7 @@
   .align ALIGNARG(2);							\
   LITERAL_POSITION;							\
   C_LABEL(name)								\
-  abi_entry(sp, FRAMESIZE);						\
-  CALL_MCOUNT
+  abi_entry(sp, FRAMESIZE);
 
 #define	HIDDEN_ENTRY(name)						\
   .globl C_SYMBOL_NAME(name);				\
@@ -55,8 +54,7 @@
   .align ALIGNARG(2);							\
   LITERAL_POSITION;							\
   C_LABEL(name)								\
-  abi_entry(sp, FRAMESIZE);						\
-  CALL_MCOUNT
+  abi_entry(sp, FRAMESIZE);
 
 #undef END
 #define END(name) ASM_SIZE_DIRECTIVE(name)
@@ -92,8 +90,6 @@
 #error Unsupported Xtensa ABI
 #endif
 #endif
-#define CALL_MCOUNT		/* Do nothing.  */
-
 
 /* Linux uses a negative return value to indicate syscall errors,
    unlike most Unices, which use the condition codes' carry flag.