From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by sourceware.org (Postfix) with ESMTPS id AE7533857C43 for ; Thu, 24 Sep 2020 05:39:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AE7533857C43 Received: by mail-pg1-x544.google.com with SMTP id m34so457654pgl.9 for ; Wed, 23 Sep 2020 22:39:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GYUFwqIM0wlVXoJTM78qwq730mKRTXVwxMB/nzQmqmk=; b=d5OTxUpBL5tfVl2sBTgL4b1cQTGcLr9tN/j+vSQDOA5O4wBWUDITc1MmqVM6prrArD E7G4MuKz89hCTpWt8tfhHevuxWk81WDtSCsBD3ta8Fqa4HJVloj/Sxx3tcNHrWi5GoO0 Nx2mW6EdySIoDK6aztZofnV6Q9wa2AayeSOlgCDS/sUOQAVvhVTiN/TSwTBAr3/oFZCb 0sIvwSyjwvmjYrhaIlqPIoMbT6xKs8sxOJnnm5u6Y+R+psUaxxrzWato7P6E/s0IR9sj V6qlx85auEKIGO1+zs8aHo0q5nGReXE80B8JEHQy+pQD5t8Ugf8zJG0OcnjXoLLwusht L6rA== X-Gm-Message-State: AOAM532GsJuBAZBEKON0E1fE75nXhFnul/dfFEpoxOLUOiqEum8keA2N C/ZLjag6mvmHuGh9ceNWKN9qSlHB5Jc= X-Google-Smtp-Source: ABdhPJwqxVw141Y3J3Q1mnLPDzlWoSIB17Y2L3Rc4SDP27RBYFAJ8ZzFgVJ0lvP1s7r6ZOhSxD5OhA== X-Received: by 2002:a63:d604:: with SMTP id q4mr2748205pgg.238.1600925976195; Wed, 23 Sep 2020 22:39:36 -0700 (PDT) Received: from bubble.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id z127sm1382477pfb.34.2020.09.23.22.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 22:39:35 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 71BF085A35; Thu, 24 Sep 2020 15:09:31 +0930 (ACST) Date: Thu, 24 Sep 2020 15:09:31 +0930 From: Alan Modra To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org Subject: Re: [RS6000] Power10 libffi fixes Message-ID: <20200924053931.GL5452@bubble.grove.modra.org> References: <20200922003011.GB5452@bubble.grove.modra.org> <20200923001657.GQ28786@gate.crashing.org> <20200924034102.GJ5452@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924034102.GJ5452@bubble.grove.modra.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2020 05:39:39 -0000 On Thu, Sep 24, 2020 at 01:11:02PM +0930, Alan Modra wrote: > I've fixed the changelog, a comment, and added a nop after bl for the > old calls without @notoc. While there really isn't a need for the > nops in libffi.so since the callee is hidden visibility, there is a > miniscule chance that a static libffi.a user has a very large TOC and > somehow manages to have ffi_call_LINUX64 and ffi_prep_args64 using > different TOC pointers. In that case the linker would arrange the > call to go via a toc-adjusting stub and want to replace the nop with a > toc restore. Adding those nops broke libffi, and I pushed the patch before bootstrap finished.. So this one committed as obvious to fix the breakage. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct location of .Lret. diff --git a/libffi/src/powerpc/linux64_closure.S b/libffi/src/powerpc/linux64_closure.S index 3e30db36190..5663bb40223 100644 --- a/libffi/src/powerpc/linux64_closure.S +++ b/libffi/src/powerpc/linux64_closure.S @@ -159,15 +159,17 @@ ffi_closure_LINUX64: # if defined _CALL_LINUX || _CALL_ELF == 2 # ifdef __PCREL__ bl ffi_closure_helper_LINUX64@notoc +.Lret: # else bl ffi_closure_helper_LINUX64 +.Lret: nop # endif # else bl .ffi_closure_helper_LINUX64 +.Lret: nop # endif -.Lret: # now r3 contains the return type # so use it to look up in a table -- Alan Modra Australia Development Lab, IBM