[PATCH] Fix command line initialisation for ARM sim

Nick Clifton nickc@cambridge.redhat.com
Tue Jan 30 17:54:00 GMT 2001

Hi Guys,

  I am applying the patch below to fix the support for passing command
  line arguments to an ARM executable.  I bropke this with my earlier
  patch to support the .init and .fini sections.


2001-12-05  Nick Clifton  <nickc@cambridge.redhat.com>

	* libc/sys/arm/crt0.S: For __USES_INITFINI__ preserve the argument
	vector before calling the initialisation functions.

Index: newlib/libc/sys/arm/crt0.S
RCS file: /cvs/cvsfiles/devo/newlib/libc/sys/arm/crt0.S,v
retrieving revision 1.20
diff -p -c -r1.20 crt0.S
*** crt0.S	2001/09/14 21:41:16	1.20
--- crt0.S	2001/12/05 11:39:50
*************** __change_mode:	
*** 187,195 ****
--- 187,199 ----
  	   to create constructors and destructors, and for these
  	   targets we need to call the _init function and arrange
  	   for _fini to be called at program exit.  */
+ 	mov	r4, r0
+ 	mov	r5, r1
  	ldr	r0, .Lfini
  	bl	FUNCTION (atexit)
  	bl	FUNCTION (_init)
+ 	mov	r0, r4
+ 	mov	r1, r5
  	bl	FUNCTION (main)

More information about the Newlib mailing list