Skip to content

Commit

Permalink
runtime: refactor the linux/loong64 entrypoint
Browse files Browse the repository at this point in the history
Remove the meaningless jump, and add the missing NOFRAME flag to _rt0_loong64_linux.

Change-Id: I1aec68c556615b42042684bd176dfc2a8af094d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/420977
Run-TryBot: M Zhuo <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: xiaodong liu <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: Meidan Li <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: WANG Xuerui <[email protected]>
  • Loading branch information
abner-chenc authored and mengzhuo committed Mar 15, 2023
1 parent 9ae97f8 commit 574c620
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/runtime/rt0_linux_loong64.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@

#include "textflag.h"

TEXT _rt0_loong64_linux(SB),NOSPLIT,$0
JMP _main<>(SB)

TEXT _main<>(SB),NOSPLIT|NOFRAME,$0
TEXT _rt0_loong64_linux(SB),NOSPLIT|NOFRAME,$0
// In a statically linked binary, the stack contains argc,
// argv as argc string pointers followed by a NULL, envv as a
// sequence of string pointers followed by a NULL, and auxv.
// There is no TLS base pointer.
MOVW 0(R3), R4 // argc
ADDV $8, R3, R5 // argv
MOVW 0(R3), R4 // argc
ADDV $8, R3, R5 // argv
JMP main(SB)

TEXT main(SB),NOSPLIT|NOFRAME,$0
Expand Down

0 comments on commit 574c620

Please sign in to comment.