mirror of https://github.com/golang/go.git
runtime: align C library startup calls on amd64
This makes GOEXPERIMENT=framepointer, GOOS=darwin, and buildmode=carchive coexist. Change-Id: I9f6fb2f0f06f27df683e5b51f2fa55cd21872453 Reviewed-on: https://go-review.googlesource.com/23454 Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
3be48b4dc8
commit
10c8b2374f
|
|
@ -12,7 +12,14 @@ TEXT _rt0_amd64_darwin(SB),NOSPLIT,$-8
|
||||||
|
|
||||||
// When linking with -shared, this symbol is called when the shared library
|
// When linking with -shared, this symbol is called when the shared library
|
||||||
// is loaded.
|
// is loaded.
|
||||||
TEXT _rt0_amd64_darwin_lib(SB),NOSPLIT,$0x48
|
TEXT _rt0_amd64_darwin_lib(SB),NOSPLIT,$0x58
|
||||||
|
// Align stack. We don't know whether Go is adding a frame pointer here or not.
|
||||||
|
MOVQ SP, R8
|
||||||
|
SUBQ $16, R8
|
||||||
|
ANDQ $~15, R8
|
||||||
|
XCHGQ SP, R8
|
||||||
|
|
||||||
|
MOVQ R8, 0x48(SP)
|
||||||
MOVQ BX, 0x18(SP)
|
MOVQ BX, 0x18(SP)
|
||||||
MOVQ BP, 0x20(SP)
|
MOVQ BP, 0x20(SP)
|
||||||
MOVQ R12, 0x28(SP)
|
MOVQ R12, 0x28(SP)
|
||||||
|
|
@ -51,6 +58,9 @@ restore:
|
||||||
MOVQ 0x30(SP), R13
|
MOVQ 0x30(SP), R13
|
||||||
MOVQ 0x38(SP), R14
|
MOVQ 0x38(SP), R14
|
||||||
MOVQ 0x40(SP), R15
|
MOVQ 0x40(SP), R15
|
||||||
|
|
||||||
|
MOVQ 0x48(SP), R8
|
||||||
|
MOVQ R8, SP
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT _rt0_amd64_darwin_lib_go(SB),NOSPLIT,$0
|
TEXT _rt0_amd64_darwin_lib_go(SB),NOSPLIT,$0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue