Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [patch] fix profiling in glibc for Linux/MIPS
@ 2001-07-26 17:39 Daniel Jacobowitz
  2001-07-27  0:48 ` Thiemo Seufer
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2001-07-26 17:39 UTC (permalink / raw)
  To: libc-alpha, linux-mips

_mcount was doing awful things to its caller's stack frame.

Theoretically, we can get by with 16 bytes less of stack than I now
allocate, but GCC still considers functions that call _mcount to be leaf
functions, so that doesn't work.  I think this is close enough; it only adds
one instruction.  Is this OK?  Do I need a "nop" after the subu?  My MIPS
assembly knowledge is not that thorough.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

--- glibc-2.2.3/sysdeps/mips/machine-gmon.h.orig	Wed Jul 25 20:09:20 2001
+++ glibc-2.2.3/sysdeps/mips/machine-gmon.h	Wed Jul 25 21:14:09 2001
@@ -35,22 +35,23 @@
         ".set noreorder;" \
         ".set noat;" \
         CPLOAD \
-        "sw $4,8($29);" \
-        "sw $5,12($29);" \
-        "sw $6,16($29);" \
-        "sw $7,20($29);" \
-        "sw $1,0($29);" \
-        "sw $31,4($29);" \
+	"subu $29,$29,40;" \
+        "sw $4,24($29);" \
+        "sw $5,28($29);" \
+        "sw $6,32($29);" \
+        "sw $7,36($29);" \
+        "sw $1,16($29);" \
+        "sw $31,20($29);" \
         "move $5,$31;" \
         "jal __mcount;" \
         "move $4,$1;" \
-        "lw $4,8($29);" \
-        "lw $5,12($29);" \
-        "lw $6,16($29);" \
-        "lw $7,20($29);" \
-        "lw $31,4($29);" \
-        "lw $1,0($29);" \
-        "addu $29,$29,8;" \
+        "lw $4,24($29);" \
+        "lw $5,28($29);" \
+        "lw $6,32($29);" \
+        "lw $7,36($29);" \
+        "lw $31,20($29);" \
+        "lw $1,16($29);" \
+        "addu $29,$29,48;" \
         "j $31;" \
         "move $31,$1;" \
         ".set reorder;" \

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-07-27  3:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-26 17:39 [patch] fix profiling in glibc for Linux/MIPS Daniel Jacobowitz
2001-07-27  0:48 ` Thiemo Seufer
2001-07-27  1:17   ` Daniel Jacobowitz
2001-07-27  2:21     ` Thiemo Seufer
2001-07-27  3:18   ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox