This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: ARM crt0.o: Add NULL to end of argv[]
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: newlib at sources dot redhat dot com, gdb-patches at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Mon, 18 Nov 2002 15:52:48 +0000
- Subject: Re: ARM crt0.o: Add NULL to end of argv[]
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
>
> > + /* Push a NULL argument onto the end of the list. */
> > + mov r2, #0
> > + #ifdef __thumb__
> > + push {r2}
> > + #else
> > + stmfd sp!, {r1}
> > + #endif
> > #endif
>
> That can't be right. The arm and thumb code push different registers!!!!
>
> R.
>
And even if you change that I'm not convinced. Surely you need to push
this extra value *before* you reverse the list. Otherwise the first
argument will be null, not the last.
R.