argv dereference in crt1.S for m68k
David McCullough
david_mccullough at au.securecomputing.com
Thu Nov 16 23:20:26 UTC 2006
Jivin Richard Sandiford lays it down ...
> Rick Garcia <rick at liveoaklogic.com> writes:
> > I'm looking at the CVS version of uClibc/libc/sysdeps/linux/m68k/crt1.S
> > for all this.
> >
> > ...working on a m68knommu system :
> >
> > I noticed this with static binaries (no shared libs) - on 2.4.31
> > uClinux. When I execute an app, the stack looks like this upon hitting
> > _start :
> >
> > %sp : argc
> > %sp(4) : argv[0]
> > ...
> > %sp(argc): null
> > %sp(argc+1): environ
>
> Have you made any local changes to uClinux? I've never used 2.4.31, but
> on 2.6.12-uc0 (the version we use), %sp(4) does indeed contain %argv,
> as crt1.S expects. The macro that controls this behaviour is
> flat_argvp_envp_on_stack(), which is defined to 1 for m68k in the
> CVS 2.4 sources:
>
> http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/~checkout~/uClinux-2.4.x/include/asm-m68knommu/flat.h?rev=1.9;content-type=text%2Fplain
The last time I checked, 2.4 and 2.6 were identical (in this respect ;-)
But that was a while ago, they both still set flat_argvp_envp_on_stack() to
be (1).
Cheers,
Davidm
--
David McCullough, david_mccullough at securecomputing.com, Ph:+61 734352815
Secure Computing - SnapGear http://www.uCdot.org http://www.cyberguard.com
More information about the uClibc
mailing list