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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

[resent patch] fix ia64 _mcount()


[I sent a similar mail a bit earlier while in the middle of a system
 upgrade and I think the mail may have been lost because of that (at
 least, it doesn't up anywhere as having been sent.  My apologies if
 this turns out to be a duplicate.]

On recent kernels, -pg-style profiling doesn't work anymore because
such kernels enforce the rule that systems-calls must be invoked with
at most 8 output registers.  Unfortunately, the _mcount() helper stub
had the effect of allocating 9 output registers.  The patch below
fixes the problem.

Thanks,

	--david

2005-03-21  David Mosberger  <davidm@hpl.hp.com>

	* sysdeps/ia64/_mcount.S: Newer kernels don't like register-frames
	with more than 8 output registers.  Fix this by passing original
	ar.pfs to _mcount_ret_helper via r3.

Index: sysdeps/ia64/_mcount.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/ia64/_mcount.S,v
retrieving revision 1.4
diff -u -r1.4 _mcount.S
--- sysdeps/ia64/_mcount.S	6 Jul 2001 04:55:54 -0000	1.4
+++ sysdeps/ia64/_mcount.S	21 Mar 2005 21:15:55 -0000
@@ -72,6 +72,7 @@
 	mov b7 = loc0
 	mov rp = in2
 	;;
+	mov r3 = in0
 	mov r8 = loc2
 	mov r15 = loc3
 	mov b6 = r2
@@ -81,10 +82,10 @@
 LOCAL_LEAF(_mcount_ret_helper)
 	.prologue
 	.altrp b7
-	.save ar.pfs, r40
+	.save ar.pfs, r3
 	.body
-	alloc r2 = ar.pfs, 0, 0, 9, 0
-	mov ar.pfs = r40
+	alloc r2 = ar.pfs, 0, 0, 8, 0
+	mov ar.pfs = r3
 	br b7
 END(_mcount_ret_helper)
 


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