From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28785 invoked by alias); 11 Dec 2014 10:31:15 -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 28757 invoked by uid 89); 11 Dec 2014 10:31:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 X-HELO: e06smtp13.uk.ibm.com Received: from e06smtp13.uk.ibm.com (HELO e06smtp13.uk.ibm.com) (195.75.94.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 11 Dec 2014 10:31:13 +0000 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Dec 2014 10:31:10 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 Dec 2014 10:31:09 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id C35971B0804B for ; Thu, 11 Dec 2014 10:31:29 +0000 (GMT) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBBAV8ql58196166 for ; Thu, 11 Dec 2014 10:31:08 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBBAV7QN023460 for ; Thu, 11 Dec 2014 03:31:08 -0700 Received: from bl3ahm9f.de.ibm.com (dyn-9-152-212-213.boeblingen.de.ibm.com [9.152.212.213]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sBBAV76g023452 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Thu, 11 Dec 2014 03:31:07 -0700 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1Xz11W-0003lz-Mr; Thu, 11 Dec 2014 11:31:06 +0100 Date: Thu, 11 Dec 2014 10:31:00 -0000 From: Dominik Vogt To: libffi-discuss@sourceware.org, gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Cc: Andreas Krebbel Subject: Re: [gofrontend-dev] Re: [PATCH 00/13] Go closures, libffi, and the static chain Message-ID: <20141211103106.GA9789@linux.vnet.ibm.com> Reply-To: libffi-discuss@sourceware.org Mail-Followup-To: libffi-discuss@sourceware.org, gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com, Andreas Krebbel References: <1412973773-3942-1-git-send-email-rth@redhat.com> <20141211090623.GA30484@linux.vnet.ibm.com> <20141211092144.GE4283@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141211092144.GE4283@bubble.grove.modra.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14121110-0013-0000-0000-0000022D4E91 X-IsSubscribed: yes X-SW-Source: 2014/txt/msg00254.txt.bz2 On Thu, Dec 11, 2014 at 07:51:44PM +1030, Alan Modra wrote: > On Thu, Dec 11, 2014 at 10:06:23AM +0100, Dominik Vogt wrote: > > On s390x, the static chain register cannot be used for passing the > > Go closure pointer to a function: According to the Abi, the > > dynamic linker is allowed to destroy the contents of r0 (static > > chain register) eventually causing a crash if libgo is linked > > dynamically. The assumption that the static chain register can be > > used to pass information to a function is wrong for s390x. > > I was worried about exactly the same "problem" on powerpc with r11 > being used for the static chain and also destroyed in linkage stubs. > It turns out we don't traverse any linkage stubs. Just to make this clear: It's not something that *might* happen. It *does* happen on s390[x] which does not use libffi but the hand written code in makefunc_s390.S and makefuncgo_s390[x].go. The same may not happen when calling functions through libffi (which may be dynamically linked) because ffi_call_go() is passed the closure pointer as an argument and not in the static chain register. > See https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00446.html. Thanks for the link. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany