ARM: Fix environment setup.

* lib/linux/arm-mes-gcc/crt1.c (_start): Fix environment setup.
This commit is contained in:
Danny Milosavljevic 2019-03-11 11:53:09 +01:00 committed by Jan Nieuwenhuizen
parent 149cc43baf
commit 25a0e13501
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 3 additions and 2 deletions

View File

@ -54,8 +54,9 @@ _start ()
asm (
"ldr r0,[fp,#4]\n\t" /* r0 = argc */
"add r1,fp,#8\n\t" /* r1 = &argv[0] */
"add r2,r1,#1\n\t" /* r2 = r1 + 1 */
"lsl r2,#2\n\t" /* r2 = (r1 + 1) << 2 */
"add r2,r0,#1\n\t" /* r2 = r0 + 1 */
"lsl r2,#2\n\t" /* r2 = (r0 + 1) << 2 */
"add r2,r2,r1\n\t" /* r2 = ((r0 + 1) << 2) + r1 */
"push {r2}\n\t" /* envp */
"push {r1}\n\t" /* argv */
"push {r0}\n\t" /* argc */