argv dereference in crt1.S for m68k

Richard Sandiford richard at codesourcery.com
Fri Nov 17 07:28:10 UTC 2006


David McCullough <david_mccullough at au.securecomputing.com> writes:
> 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).

OK, thanks.  (Rick: looking back, my message wasn't very clear, so in
case there's any doubt: a value of (1) selects the behaviour crt1.S expects,
while a value of (0) selects the behaviour you described.)

Richard



More information about the uClibc mailing list