From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 3E5AA2F6BF for ; Wed, 23 Oct 2024 00:58:52 +0200 (CEST) Received: (qmail 30415 invoked by uid 550); 22 Oct 2024 22:58:47 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com x-ms-reactions: disallow Received: (qmail 30365 invoked from network); 22 Oct 2024 22:58:46 -0000 Date: Tue, 22 Oct 2024 18:58:38 -0400 From: Rich Felker To: Alex =?utf-8?B?UsO4bm5l?= Petersen Cc: musl@lists.openwall.com Message-ID: <20241022225838.GT10433@brightrain.aerifal.cx> References: <20240918011842.26118-1-alex@alexrp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240918011842.26118-1-alex@alexrp.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH] mips: use `jr $ra` instead of `j $ra` to work around an LLVM assembler bug On Wed, Sep 18, 2024 at 03:18:42AM +0200, Alex Rønne Petersen wrote: > Details here: https://github.com/llvm/llvm-project/issues/107460 > > This patch works around the bug by just using the `jr $ra` form, which also more > precisely indicates the encoding intent anyway. > --- > crt/mips/crtn.s | 4 ++-- > crt/mips64/crtn.s | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/crt/mips/crtn.s b/crt/mips/crtn.s > index 506a04b7..92eb3d0e 100644 > --- a/crt/mips/crtn.s > +++ b/crt/mips/crtn.s > @@ -3,11 +3,11 @@ > .section .init > lw $gp,24($sp) > lw $ra,28($sp) > - j $ra > + jr $ra > addu $sp,$sp,32 > > .section .fini > lw $gp,24($sp) > lw $ra,28($sp) > - j $ra > + jr $ra > addu $sp,$sp,32 > diff --git a/crt/mips64/crtn.s b/crt/mips64/crtn.s > index f3930b24..8f090ed3 100644 > --- a/crt/mips64/crtn.s > +++ b/crt/mips64/crtn.s > @@ -3,11 +3,11 @@ > .section .init > ld $gp,16($sp) > ld $ra,24($sp) > - j $ra > + jr $ra > daddu $sp,$sp,32 > > .section .fini > ld $gp,16($sp) > ld $ra,24($sp) > - j $ra > + jr $ra > daddu $sp,$sp,32 > -- > 2.40.1 Thanks. Applying this with the same applied to mipsn32 too. Rich