From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id E876D3858D32 for ; Mon, 22 Jan 2024 16:12:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E876D3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E876D3858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.174.156.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705939922; cv=none; b=CKlD2yMsz/BiiiKdolIOrX55n8svgsUZC1brVa9ewxQsCI6p6Ms7hdrO2snRqQTGYlDQ9CHHkkSSf5Jg8KBLq2IqQVLXpylSZguIcJugT5nF5gmyB41GBtU0ryJsef2RYnPY4QM01VJMumXHZ6T6k5nfW4cJU6vy8Z6RQyaUD8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705939922; c=relaxed/simple; bh=dIf1sb5u0OTEfKyW8UoXwgWmOVgvdBxi7aUJAedPIm0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RC9Bb3LR9faBazyMwWMgDRdz+X8Svw4wEUmWgTZr+v1pDcHyYhW3WVeWIcnlVWQyeiWKXloD/YljtAtkEczA0iziF5n7Iy/3hSBK0m6UpR+y8H0f4Y247/cIWAVlT5M50yZDMSLRZbP9ewI703uFwRyyNyy1dH6PjMJa1ZnAjsU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9sU3sm7UEw14zDOPhCF05Eu5/9RgzDoIIt0fYlzqTPs=; b=Qxn1jvi2Z1uZcoNPPsqLyhFM6X eVGbBKsoH13/iKWw8A13kiXNNcfdHnNQshflgRQvhXBvpjudbCAdsrvS+fzjlljViW8IiGVr3boVW na0gmGI4VzcrtKQOP4urMawBObSyjW11DpNWFWi0cxpjfYWjGXmm24oCRrgOS0m6yirv+ffHRBzp3 Vsmo6ELHZ7ju86VpNjIZ4SfBDH3LqDRsq2SoR+y/0Z27m7ZngIfZl5e7DQF4PaAFvUeHXgOXiMk94 JOB0bnclOjDRCp+D0uup0206z2SUMqaOwqJs1QcV8rrlqiYzEkLcnsp026ntmNOY9xkho/eASSqLB FguyZTcw==; Received: from [95.42.20.142] (port=38640 helo=kendros.lan) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rRwtx-0003Bi-1L; Mon, 22 Jan 2024 18:11:59 +0200 From: Dimitar Dimitrov To: newlib@sourceware.org Cc: Dimitar Dimitrov Subject: [PATCH v4 2/2] libgloss: pru: Trim crt0-minrt.o Date: Mon, 22 Jan 2024 18:11:36 +0200 Message-ID: <20240122161136.4103003-2-dimitar@dinux.eu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122161136.4103003-1-dimitar@dinux.eu> References: <20240122161136.4103003-1-dimitar@dinux.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Strip a few more instructions from crt0-minrt.S: - Remove "halt" and rely on the infinite loop after main()'s return. - Remove main()'s argc and argv argument initialization. Host loader does not set them, and typical firmware does not use them, either. - Remove the __dso_handle symbol. This should be safe because the default crt0.S is fully standards compliant. Whereas crt0-minrt.S has been documented from the beginning to intentionally miss features in order to reduce firmware size, while still enabling typical PRU firmware to operate. Signed-off-by: Dimitar Dimitrov --- libgloss/pru/crt0-minrt.S | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/libgloss/pru/crt0-minrt.S b/libgloss/pru/crt0-minrt.S index 60647d372..fa5e80af4 100644 --- a/libgloss/pru/crt0-minrt.S +++ b/libgloss/pru/crt0-minrt.S @@ -38,22 +38,9 @@ _start: /* DATA and BSS are handled by the loader, so nothing to do here. */ - /* Just in case main() tries to access argc, argv[] and envp. */ - zero r14, 3 * 4 - - /* Call main. */ + /* Call main. Assume argc and argv are not used with -minrt! */ call main /* We should never reach here. */ _crt_exit: - halt jmp _crt_exit - - /* PRU obviously has no shared libraries, but dso_handle - helps to achieve better GCC test coverage. Besides, - it should be free with minrt. */ - .section .data - .global __dso_handle - .weak __dso_handle -__dso_handle: - .long 0 -- 2.43.0