crt1.S start code

Lei Sun lei_sun at comcast.net
Fri Dec 23 20:53:15 UTC 2005


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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/uclibc/attachments/20051223/c6a5effe/attachment-0002.htm 


More information about the uClibc mailing list