Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* ARM crt0.o: Add NULL to end of argv[]
@ 2002-11-18  7:20 Nick Clifton
  2002-11-18  7:50 ` Richard Earnshaw
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2002-11-18  7:20 UTC (permalink / raw)
  To: newlib; +Cc: gdb-patches

Hi Guys,

  I am applying the patch below to fix a small bug in the ARM crt0.o
  file for newlib.  The code was creating an argv[] array from the
  command line, but it was not terminating the array with a NULL
  pointer.  This is required by the ISO C specification, and this
  patch fixes the problem.

Cheers
        Nick

2002-11-18  Nick Clifton  <nickc@redhat.com>

	* libc/sys/arm/crt0.S: Add NULL to end of argv array.

Index: newlib/libc/sys/arm/crt0.S
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/arm/crt0.S,v
retrieving revision 1.6
diff -c -3 -p -w -r1.6 crt0.S
*** newlib/libc/sys/arm/crt0.S	30 Apr 2002 18:23:38 -0000	1.6
--- newlib/libc/sys/arm/crt0.S	18 Nov 2002 15:19:11 -0000
*************** __change_mode:	
*** 181,186 ****
--- 181,193 ----
  	bhi	.LC13
  #endif
  
+ 	/* Push a NULL argument onto the end of the list.  */
+ 	mov	r2, #0
+ #ifdef __thumb__
+ 	push	{r2}
+ #else
+ 	stmfd	sp!, {r1}
+ #endif
  #endif
  
  #ifdef __USES_INITFINI__


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-18 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-18  7:20 ARM crt0.o: Add NULL to end of argv[] Nick Clifton
2002-11-18  7:50 ` Richard Earnshaw
2002-11-18  7:53   ` Richard Earnshaw
2002-11-18  8:30     ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox