From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28835 invoked by alias); 6 Nov 2014 13:10:17 -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 28667 invoked by uid 89); 6 Nov 2014 13:10:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 X-HELO: e8.ny.us.ibm.com Received: from e8.ny.us.ibm.com (HELO e8.ny.us.ibm.com) (32.97.182.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 06 Nov 2014 13:10:15 +0000 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Nov 2014 08:10:13 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 6 Nov 2014 08:10:12 -0500 Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 877D76E8046 for ; Thu, 6 Nov 2014 08:10:10 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sA6DABhR25624742 for ; Thu, 6 Nov 2014 13:10:11 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sA6DAAIC030090 for ; Thu, 6 Nov 2014 08:10:11 -0500 Received: from oc2602623110.ibm.com (oc2602623110.ibm.com.rchland.ibm.com [9.10.86.28]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sA6DA99p030040; Thu, 6 Nov 2014 08:10:10 -0500 Message-ID: <545B7331.7040500@linux.vnet.ibm.com> Date: Thu, 06 Nov 2014 13:10:00 -0000 From: "Lynn A. Boger" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0 MIME-Version: 1.0 To: Richard Henderson , gcc-patches@gcc.gnu.org, libffi-discuss@sourceware.org, gofrontend-dev@googlegroups.com Subject: Re: [PATCH 00/13] Go closures, libffi, and the static chain References: <1412973773-3942-1-git-send-email-rth@redhat.com> <545A97BA.3030507@linux.vnet.ibm.com> <545B1C44.3000306@redhat.com> <20141106124838.GJ30857@bubble.grove.modra.org> In-Reply-To: <20141106124838.GJ30857@bubble.grove.modra.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14110613-0029-0000-0000-0000010ABDD3 X-IsSubscribed: yes X-SW-Source: 2014/txt/msg00184.txt.bz2 Aren't there cases where the static chain register is needed? How does that work if it could be trashed on a plt call? On 11/06/2014 06:48 AM, Alan Modra wrote: > On Thu, Nov 06, 2014 at 07:59:16AM +0100, Richard Henderson wrote: >> I haven't done powerpc yet. If you'd like to help, I'd be delighted. > I was going to say that it doesn't look too difficult, but then I > noticed we have a problem. PowerPC uses r11 as the static chain, > a register that is allowed to be used by linkage stubs. > > So any call to a shared libffi will (or may) blow away r11. On ppc32, > every plt call currently uses r11. On ppc64 ELFv1 most plt calls do > (in fact r11 is loaded from the third word of the plt function > descriptor if using a standard plt stub). On ppc64 ELFv2 just the > lazy plt resolution trashes r11. >