From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25375 invoked by alias); 14 Nov 2013 01:41:35 -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 25364 invoked by uid 89); 14 Nov 2013 01:41:34 -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-f178.google.com Received: from Unknown (HELO mail-pd0-f178.google.com) (209.85.192.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 14 Nov 2013 01:41:33 +0000 Received: by mail-pd0-f178.google.com with SMTP id p10so1254537pdj.9 for ; Wed, 13 Nov 2013 17:41:25 -0800 (PST) X-Received: by 10.66.132.69 with SMTP id os5mr44078429pab.114.1384393285531; Wed, 13 Nov 2013 17:41:25 -0800 (PST) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPSA id nj9sm47434472pbc.13.2013.11.13.17.41.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Nov 2013 17:41:24 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 1C820EA006D; Thu, 14 Nov 2013 12:11:21 +1030 (CST) Date: Thu, 14 Nov 2013 01:41:00 -0000 From: Alan Modra To: libffi-discuss@sourceware.org Subject: Re: Support PowerPC64 ELFv2 ABI Message-ID: <20131114014120.GG20756@bubble.grove.modra.org> References: <20131113152512.GF20756@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131113152512.GF20756@bubble.grove.modra.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013/txt/msg00209.txt.bz2 On Thu, Nov 14, 2013 at 01:55:12AM +1030, Alan Modra wrote: > Finally, this adds _CALL_ELF == 2 support. ELFv1 objects can't be > linked with ELFv2 objects, so this is one case where preprocessor > tests in ffi.c are fine. Also, there is no need to define a new > FFI_ELFv2 or somesuch value in enum ffi_abi. FFI_LINUX64 will happily > serve both ABIs. Oops. This one contained an error introduced by last minute changes, and I didn't wait for my le bootstrap to finish last night before posting.. * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use #if _CALL_ELF test to select parameter save sizing for ELFv2 vs. ELFv1. diff --git a/src/powerpc/ffi.c b/src/powerpc/ffi.c index 69356a2..feb2144 100644 --- a/src/powerpc/ffi.c +++ b/src/powerpc/ffi.c @@ -1072,13 +1072,13 @@ ffi_prep_cif_machdep_core (ffi_cif *cif) #endif /* Stack space. */ - if (cif->abi == FFI_LINUX64) - { - if (intarg_count > NUM_GPR_ARG_REGISTERS64) - bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long); - } - else if ((flags & FLAG_ARG_NEEDS_PSAVE) != 0) +#if _CALL_ELF == 2 + if ((flags & FLAG_ARG_NEEDS_PSAVE) != 0) bytes += intarg_count * sizeof (long); +#else + if (intarg_count > NUM_GPR_ARG_REGISTERS64) + bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long); +#endif } /* The stack space allocated needs to be a multiple of 16 bytes. */ -- Alan Modra Australia Development Lab, IBM