From 9333b323a5d63ba31595aa3f832e7338584a371f Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 18 Sep 2018 23:39:04 +0200 Subject: [PATCH] Make the MIPS boot code produce correct code. --- plat/linuxmips/boot.s | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plat/linuxmips/boot.s b/plat/linuxmips/boot.s index eed95ebd4..7f5ff16c2 100644 --- a/plat/linuxmips/boot.s +++ b/plat/linuxmips/boot.s @@ -8,7 +8,8 @@ .sect .text -begtext: +.define .entry +.entry: ! This code is placed at the beginning of the ELF executable and is the ! first thing that runs. ! @@ -29,13 +30,13 @@ begtext: lw r4, 0(sp) ! r4 = argc addiu r5, sp, 4 ! r5 = argv sll r6, r4, 2 ! r6 = argc*4 - addu r6, r6, r5 ! r6 = last arg - addiu r6, r6, 8 ! r6 = env + addu r6, r6, r5 ! r6 = null after last arg + addiu r6, r6, 4 ! r6 = env addiu sp, sp, -3 * 4 - sw r4, 0(sp) - sw r5, 4(sp) - sw r6, 8(sp) + sw r4, 0(sp) ! argc + sw r5, 4(sp) ! argv + sw r6, 8(sp) ! envp j __m_a_i_n nop