]> Cypherpunks.ru repositories - gostls13.git/commitdiff
syscall: restore nosplit for ptrace1 on Darwin
authorCherry Zhang <cherryyz@google.com>
Tue, 27 Apr 2021 14:54:09 +0000 (10:54 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 27 Apr 2021 17:18:15 +0000 (17:18 +0000)
ptrace1 must be nosplit because it is called from
forAndExecInChild. It was marked nosplit in the generated code
but not in the generator. CL 313230 regenerated the code and lost
the nosplit mark. This CL restores it.

Change-Id: I4645d83650f1818bed3cb650328bba97074b6b2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/314249
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/syscall/mksyscall.pl
src/syscall/zsyscall_darwin_amd64.go
src/syscall/zsyscall_darwin_arm64.go

index 452ab6c96ac7c761a9771ad50646e788ec0faacc..5ca3b465d804650b2ee566164782609e7875f638 100755 (executable)
@@ -137,7 +137,7 @@ while(<>) {
        # without reading the header.
        $text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
 
-       if (($darwin || ($openbsd && $libc)) && $func eq "ptrace") {
+       if (($darwin && $func eq "ptrace1") || (($openbsd && $libc) && $func eq "ptrace")) {
                # The ptrace function is called from forkAndExecInChild where stack
                # growth is forbidden.
                $text .= "//go:nosplit\n"
index 369f5a1702d41ae29f1949a7d7ab5997ca4334d8..07a519d7d65fa92463e100d88b037abf71cd67c6 100644 (file)
@@ -1972,6 +1972,7 @@ func libc_fstatat64_trampoline()
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+//go:nosplit
 func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
        _, _, e1 := syscall6(abi.FuncPCABI0(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
        if e1 != 0 {
index 2185f324c1415e81d178562c582d23fc8f9f46b2..5ae096730eae21ee5858b4ab9b7f4d594935a03c 100644 (file)
@@ -1972,6 +1972,7 @@ func libc_fstatat_trampoline()
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+//go:nosplit
 func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
        _, _, e1 := syscall6(abi.FuncPCABI0(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
        if e1 != 0 {