This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix command line initialisation for ARM sim


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.

Cheers
        Nick

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
  #endif	
  	bl	FUNCTION (main)
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]