public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] libgloss: pru: Trim crt0-minrt.o
@ 2024-01-23  8:51 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2024-01-23  8:51 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=276dd12f69b1cf113a009da331d3bcfc4783fdce

commit 276dd12f69b1cf113a009da331d3bcfc4783fdce
Author:     Dimitar Dimitrov <dimitar@dinux.eu>
AuthorDate: Mon Jan 22 18:11:36 2024 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Tue Jan 23 09:49:02 2024 +0100

    libgloss: pru: Trim crt0-minrt.o
    
    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 <dimitar@dinux.eu>

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:
 
 	/* 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-23  8:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23  8:51 [newlib-cygwin/main] libgloss: pru: Trim crt0-minrt.o Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).