From patchwork Mon Jun 24 13:38:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 1121273 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="i78Yujhy"; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XVjg1zqDz9s3l for ; Mon, 24 Jun 2019 23:38:15 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 1C61B10065; Mon, 24 Jun 2019 15:38:11 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by helium.openadk.org (Postfix) with ESMTPS id 9A01210065 for ; Mon, 24 Jun 2019 15:38:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=n3/+QESVW7abJOVqNMqYsPTAsRr2D01WJI1oqxxR4mg=; b=i78YujhyqRSWlQmDymhitdPWF0 DfQHrd2Oj7Z/NuZT7TP2jtIjrUPKOiycxfPz6pgCgNBngQOSMle+9CmX5YITcIOR4bOmXpWGesFoa ruWz4wygwUTmECQKUZI8+RiP/FmVJhQ+rvOxjqQSttP449xS/7jLJcw59tyAmFGHubOp95L1Ckmg8 SV8dvEZ92cJw5eOQ6V/xKfShTyIUwJgt8kjJHNNjHK8rNUif6OsxW1mPPutaQgGbLC7mjQ76zOkaE RU6hXfS59ZpKpiujquH6GJLc0Fp2i+xSCc8CHYxXPayZO1XWuS3KrNwVZX9cMFlaVBzvyVa4MOc38 mxwQOUow==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hfPAf-00052w-BB for devel@uclibc-ng.org; Mon, 24 Jun 2019 13:38:09 +0000 Date: Mon, 24 Jun 2019 06:38:09 -0700 From: Christoph Hellwig To: devel@uclibc-ng.org Message-ID: <20190624133809.GB18527@infradead.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Subject: [uclibc-ng-devel] [PATCH] riscv: clear a3/a4 in crt1 X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" From: Christoph Hellwig We don't support shared libraries and thus _init/_fini. But loading nommu binaries blows they aren't cleared, so do that. Signed-off-by: Christoph Hellwig --- libc/sysdeps/linux/riscv64/crt1.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libc/sysdeps/linux/riscv64/crt1.S b/libc/sysdeps/linux/riscv64/crt1.S index 872e0b12e..1e8403d26 100644 --- a/libc/sysdeps/linux/riscv64/crt1.S +++ b/libc/sysdeps/linux/riscv64/crt1.S @@ -52,6 +52,11 @@ _start: la a0, main REG_L a1, 0(sp) /* argc. */ addi a2, sp, SZREG /* argv. */ + /* + * No support fo app_init/app_fini as we don't support shared libraries. + */ + mv a3, zero + mv a4, zero andi sp, sp, ALMASK /* Align stack. */ mv a6, sp /* stack_end. */