crt1.S start code
Lei Sun
lei_sun at comcast.net
Fri Dec 23 20:55:30 UTC 2005
Sorry, I meant,the
" mov a3, sp" statement should be "ldr a3, [sp]"
comments?
Thanks!
lei
----- Original Message -----
From: Lei Sun
To: uclibc at uclibc.org
Sent: Friday, December 23, 2005 3:53 PM
Subject: crt1.S start code
Hi :
I was trying to debug my application built with uClibc-0.9.28, for xscale based platform. I couldn't get correct argv passing into my main program, so I dug into the crt1.S code, (in sysdeps/linux/arm/crt1.S)
_start:
/* clear the frame pointer and link registers */
mov fp, #0
mov lr, #0
/* pop argc off the stack and save a pointer to argv */
ldr a2, [sp], #4
mov a3, sp
Here, shouldn't the a3 be the actual argv? therefore it should be
mov a3, [sp]
in linux/asm/proc-armv/processor.h , start_thread is defined such that
regs->ARM_r0=stack[0]
regs->ARM_r1=stack[1].
so clearly, argv is store in the start_stack + 4 ,
Thank you!
lei
------------------------------------------------------------------------------
_______________________________________________
uClibc mailing list
uClibc at uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/uclibc/attachments/20051223/dac1af11/attachment.htm
More information about the uClibc
mailing list