Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: fixup darwin/arm64 framepointer assembly #39524
Hey @cherrymui, I just tried to do what you said, and ended up with a crash, using Go 1.13.8.
Here is the diff, just in case I'm missing something from your directives:
diff --git a/src/runtime/sys_darwin_arm64.s b/src/runtime/sys_darwin_arm64.s index ac3ca74f63..63becfb630 100644 --- a/src/runtime/sys_darwin_arm64.s +++ b/src/runtime/sys_darwin_arm64.s @@ -15,14 +15,12 @@ TEXT notok<>(SB),NOSPLIT,$0 MOVD R8, (R8) B 0(PC) -TEXT runtime·open_trampoline(SB),NOSPLIT,$0 - SUB $16, RSP +TEXT runtime·open_trampoline(SB),NOSPLIT,$16 MOVW 8(R0), R1 // arg 2 flags MOVW 12(R0), R2 // arg 3 mode MOVW R2, (RSP) // arg 3 is variadic, pass on stack MOVD 0(R0), R0 // arg 1 pathname BL libc_open(SB) - ADD $16, RSP RET TEXT runtime·close_trampoline(SB),NOSPLIT,$0
Also, what was the reason for the frame to be manually allocated, rather than via declaration?