This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fixes for powerpc64 libc_p


On Wed, Oct 06, 2004 at 03:09:19PM -0700, Ulrich Drepper wrote:
> I added the patch.

Thanks.  Here are some more places in powerpc64 assembly that should
call _mcount.

Removing the #undef PROF in ppc-mcount.S is really about removing a
comment that is no longer accurate.  For powerpc64-linux, ENTRY et al do
not magically call _mcount when profiling, so there is no possibily of
recursive _mcount calls here.

	* sysdeps/powerpc/powerpc64/ppc-mcount.S (PROF): Don't undef.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S: Invoke CALL_MOUNT.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.

Index: sysdeps/powerpc/powerpc64/ppc-mcount.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/powerpc64/ppc-mcount.S,v
retrieving revision 1.1
diff -u -p -r1.1 ppc-mcount.S
--- sysdeps/powerpc/powerpc64/ppc-mcount.S	17 Sep 2002 23:50:02 -0000	1.1
+++ sysdeps/powerpc/powerpc64/ppc-mcount.S	7 Oct 2004 03:15:46 -0000
@@ -17,11 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-/* This would be bad.  */
-#ifdef PROF
-#undef PROF
-#endif
-
 #include <sysdep.h>
 /* We don't need to save the parameter-passing registers as gcc takes
    care of that for us.  Thus this function looks fairly normal.
Index: sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S,v
retrieving revision 1.2
diff -u -p -r1.2 brk.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S	12 Jun 2003 22:29:43 -0000	1.2
+++ sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S	7 Oct 2004 03:15:47 -0000
@@ -29,6 +29,7 @@
 	.tc __curbrk[TC],__curbrk
 	.section ".text"
 ENTRY (BP_SYM (__brk))
+	CALL_MCOUNT 1
 	DISCARD_BOUNDS (r3)	/* the bounds are meaningless, so toss 'em.  */
 
 	stdu    r1,-64(r1)
Index: sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S,v
retrieving revision 1.3
diff -u -p -r1.3 clone.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S	1 Apr 2004 21:14:09 -0000	1.3
+++ sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S	7 Oct 2004 03:15:47 -0000
@@ -32,6 +32,7 @@
                   void *tls [r8], void *child_tid [r9]); */
 
 ENTRY (BP_SYM (__clone))
+	CALL_MCOUNT 7
 	/* GKM FIXME: add bounds checks, where sensible.  */
 	DISCARD_BOUNDS (r4)
 	DISCARD_BOUNDS (r6)
Index: sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S,v
retrieving revision 1.9
diff -u -p -r1.9 getcontext.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S	15 Jun 2004 20:02:20 -0000	1.9
+++ sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S	7 Oct 2004 03:15:48 -0000
@@ -30,6 +30,7 @@
 
 #if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
 ENTRY(__novec_getcontext)
+	CALL_MCOUNT 1
 #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   std  r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
   std  r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
@@ -167,6 +168,7 @@ compat_symbol (libc, __novec_getcontext,
 
 	.machine	"altivec"
 ENTRY(__getcontext)
+	CALL_MCOUNT 1
 #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   std  r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
   std  r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
Index: sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S,v
retrieving revision 1.5
diff -u -p -r1.5 makecontext.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S	1 Apr 2004 21:16:58 -0000	1.5
+++ sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S	7 Oct 2004 03:15:48 -0000
@@ -26,6 +26,7 @@
 #include <asm/errno.h>
 
 ENTRY(__makecontext)
+	CALL_MCOUNT 3
 #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   /* Save parameters into the parameter save area of callers frame.  */
   std  r3,FRAME_PARM1_SAVE(r1) /* ucontext_t *ucp  */
Index: sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S,v
retrieving revision 1.8
diff -u -p -r1.8 setcontext.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S	15 Jun 2004 20:02:20 -0000	1.8
+++ sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S	7 Oct 2004 03:15:48 -0000
@@ -29,6 +29,7 @@
 
 #if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
 ENTRY(__novec_setcontext)
+	CALL_MCOUNT 1
 #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   mflr  r0
   std   r31,-8(1)
@@ -194,6 +195,7 @@ compat_symbol (libc, __novec_setcontext,
 
 	.machine	"altivec"
 ENTRY(__setcontext)
+	CALL_MCOUNT 1
 #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   mflr  r0
   std   r31,-8(1)
Index: sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S,v
retrieving revision 1.4
diff -u -p -r1.4 socket.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S	14 Jul 2003 23:05:50 -0000	1.4
+++ sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S	7 Oct 2004 03:15:48 -0000
@@ -51,6 +51,7 @@
 
 	.text
 ENTRY(__socket)
+	CALL_MCOUNT NARGS
 	cfi_startproc
 	stdu r1,-144(r1)
 	cfi_adjust_cfa_offset(144)
Index: sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S,v
retrieving revision 1.9
diff -u -p -r1.9 swapcontext.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S	15 Jun 2004 20:02:20 -0000	1.9
+++ sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S	7 Oct 2004 03:15:48 -0000
@@ -29,6 +29,7 @@
 
 #if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
 ENTRY(__novec_swapcontext)
+	CALL_MCOUNT 2
 #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   std  r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
   std  r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
@@ -289,6 +290,7 @@ compat_symbol (libc, __novec_swapcontext
 
 	.machine	"altivec"
 ENTRY(__swapcontext)
+	CALL_MCOUNT 2
 #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   std  r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
   std  r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
Index: sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S,v
retrieving revision 1.1
diff -u -p -r1.1 vfork.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S	15 Jan 2003 00:49:54 -0000	1.1
+++ sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S	7 Oct 2004 03:15:49 -0000
@@ -27,6 +27,7 @@
    and the process ID of the new process to the old process.  */
 
 ENTRY (__vfork)
+	CALL_MCOUNT 0
 
 #ifdef __NR_vfork
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]