From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2053 invoked by alias); 20 Nov 2013 07:33:47 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 2034 invoked by uid 89); 20 Nov 2013 07:33:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RDNS_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f173.google.com Received: from Unknown (HELO mail-pd0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 20 Nov 2013 07:33:45 +0000 Received: by mail-pd0-f173.google.com with SMTP id p10so1622911pdj.32 for ; Tue, 19 Nov 2013 23:33:37 -0800 (PST) X-Received: by 10.68.236.133 with SMTP id uu5mr1079980pbc.153.1384932817441; Tue, 19 Nov 2013 23:33:37 -0800 (PST) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPSA id gg10sm35624943pbc.46.2013.11.19.23.33.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 23:33:36 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id A6A23EA006D; Wed, 20 Nov 2013 18:03:32 +1030 (CST) Date: Wed, 20 Nov 2013 07:33:00 -0000 From: Alan Modra To: libffi-discuss@sourceware.org Subject: PowerPC64 ELFv2 fix 1 of 2 Message-ID: <20131120073332.GF22514@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013/txt/msg00216.txt.bz2 Using the return value area as a place to pass parameters wasn't such a good idea, causing a failure of cls_ulonglong.c. I didn't see this when running the mainline gcc libffi testsuite because that version of the test is inferior to the upstreamm libffi test. * src/powerpc/linux64_closure.S: Don't use the return value area as a parameter save area on ELFv2. diff --git a/src/powerpc/linux64_closure.S b/src/powerpc/linux64_closure.S index 9b6b5f3..4d012cc 100644 --- a/src/powerpc/linux64_closure.S +++ b/src/powerpc/linux64_closure.S @@ -60,13 +60,11 @@ ffi_closure_LINUX64: # endif # if _CALL_ELF == 2 -# 32 byte special reg save area + 64 byte parm save area and retval -# + 13*8 fpr save area + round to 16 -# define STACKFRAME 208 +# 32 byte special reg save area + 64 byte parm save area +# + 64 byte retval area + 13*8 fpr save area + round to 16 +# define STACKFRAME 272 # define PARMSAVE 32 -# No parameter save area is needed for the call to ffi_closure_helper_LINUX64, -# so return value can start there. -# define RETVAL PARMSAVE +# define RETVAL PARMSAVE+64 # else # 48 bytes special reg save area + 64 bytes parm save area # + 16 bytes retval area + 13*8 bytes fpr save area + round to 16 @@ -85,8 +83,8 @@ ffi_closure_LINUX64: bt 7, .Lparmsave # Our caller has not allocated a parameter save area. # We need to allocate one here and use it to pass gprs to - # ffi_closure_helper_LINUX64. The return value area will do. - addi %r12, %r1, -STACKFRAME+RETVAL + # ffi_closure_helper_LINUX64. + addi %r12, %r1, -STACKFRAME+PARMSAVE .Lparmsave: std %r0, 16(%r1) # Save general regs into parm save area -- Alan Modra Australia Development Lab, IBM