lib: Fix asm code in _start for SPARC

SPARCs have delayed branches, that is, it will unconditionally
run the next instruction following a branch.
Slightly reorder the _start code sequence to prevent it from
accidentally executing stray instructions, which may result in odd
program behavior.
This commit is contained in:
Koakuma 2023-09-17 19:18:59 +07:00 committed by Andrew Kelley
parent 67ee68fc9e
commit 375bb5f4a1

View File

@ -327,8 +327,8 @@ fn _start() callconv(.Naked) noreturn {
// argc is stored after a register window (16 registers) plus stack bias
\\ mov %%g0, %%i6
\\ add %%o6, 2175, %%l0
\\ stx %%l0, %[argc_argv_ptr]
\\ ba %[posixCallMainAndExit]
\\ stx %%l0, %[argc_argv_ptr]
,
else => @compileError("unsupported arch"),
}