From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29731 invoked by alias); 15 Dec 2004 11:33:33 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 29711 invoked from network); 15 Dec 2004 11:33:32 -0000 Received: from unknown (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org with SMTP; 15 Dec 2004 11:33:32 -0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id iBFBXUll014549; Wed, 15 Dec 2004 12:33:30 +0100 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id iBFBXTKg014548; Wed, 15 Dec 2004 12:33:29 +0100 Date: Wed, 15 Dec 2004 11:33:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix tst-getpid{1,2} on ppc64 Message-ID: <20041215113329.GQ5149@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-SW-Source: 2004-12/txt/msg00052.txt.bz2 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 * 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