public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix tst-getpid{1,2} on ppc64
@ 2004-12-15 11:33 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2004-12-15 11:33 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

Seems ppc64 is not restoring r2 and so crashes when _exit is called
with bogus toc register.  I haven't tested this patch yet, but
will do RSN, certainly if tst-getpid1.c is modified to call _exit (1)
resp. _exit (0) instead of return {1,0}, it succeeds (well, I have one day
old glibc, so fails with wrong signal value, but the child doesn't crash).

2004-12-15  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S (__clone): Save
	and restore r2 around call to fn.

--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S.jj	2004-12-15 12:21:04.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S	2004-12-15 12:26:22.049075256 +0100
@@ -104,12 +104,14 @@ L(nomoregetpid):
 L(oldpid):
 #endif
 
+	std	r2,40(r1)
 	/* Call procedure.  */
 	ld	r0,0(r29)
 	ld	r2,8(r29)
 	mtctr	r0
 	mr	r3,r31
 	bctrl
+	ld	r2,40(r1)
 	/* Call _exit with result from procedure.  */
 #ifdef SHARED
 	b	JUMPTARGET(__GI__exit)

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-15 11:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-15 11:33 [PATCH] Fix tst-getpid{1,2} on ppc64 Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).