From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 2AD3C3858429; Tue, 23 Jan 2024 08:51:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AD3C3858429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705999873; bh=uHges6Se0EanGjMJl06sZGvwx5/zrxW1I2XsqQN/95Y=; h=From:To:Subject:Date:From; b=WOZ51hL/UC6M3EOXjNwH/DqqfxXfHihkDU2pxAw0HCMYTy5hxSxF5uZ8VSqGlhoi1 JCVTr1tTAnngfX5E4quG9VZLH5mgSbs6Gh1sqh2kB9LtoCKajciA1L9gXHmv5SnIT1 iSb86nCAVA9Iqu930HeE0bT1PU6jS7HyvWKHnE/o= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] libgloss: pru: Trim crt0-minrt.o X-Act-Checkin: newlib-cygwin X-Git-Author: Dimitar Dimitrov X-Git-Refname: refs/heads/main X-Git-Oldrev: d5c4edca81c87c784b4420cc194bea07436e0ab7 X-Git-Newrev: 276dd12f69b1cf113a009da331d3bcfc4783fdce Message-Id: <20240123085113.2AD3C3858429@sourceware.org> Date: Tue, 23 Jan 2024 08:51:12 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D276dd12f69b= 1cf113a009da331d3bcfc4783fdce commit 276dd12f69b1cf113a009da331d3bcfc4783fdce Author: Dimitar Dimitrov AuthorDate: Mon Jan 22 18:11:36 2024 +0200 Commit: Corinna Vinschen CommitDate: Tue Jan 23 09:49:02 2024 +0100 libgloss: pru: Trim crt0-minrt.o =20 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. =20 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. =20 Signed-off-by: Dimitar Dimitrov Diff: --- 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 60647d372e55..fa5e80af4802 100644 --- a/libgloss/pru/crt0-minrt.S +++ b/libgloss/pru/crt0-minrt.S @@ -38,22 +38,9 @@ _start: =20 /* DATA and BSS are handled by the loader, so nothing to do here. */ =20 - /* 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 =20 /* 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