aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2021-04-27 10:54:09 -0400
committerCherry Zhang <cherryyz@google.com>2021-04-27 17:18:15 +0000
commit222101549a1b0d9810e2069f776c92b6807a739d (patch)
tree61b31225d78a434a848f7015df58036cc566b1ed /src/syscall
parentcde6a675bccb95f0660e302965065eeef6a68128 (diff)
downloadgo-222101549a1b0d9810e2069f776c92b6807a739d.tar.gz
go-222101549a1b0d9810e2069f776c92b6807a739d.zip
syscall: restore nosplit for ptrace1 on Darwin
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>
Diffstat (limited to 'src/syscall')
-rwxr-xr-xsrc/syscall/mksyscall.pl2
-rw-r--r--src/syscall/zsyscall_darwin_amd64.go1
-rw-r--r--src/syscall/zsyscall_darwin_arm64.go1
3 files changed, 3 insertions, 1 deletions
diff --git a/src/syscall/mksyscall.pl b/src/syscall/mksyscall.pl
index 452ab6c96a..5ca3b465d8 100755
--- a/src/syscall/mksyscall.pl
+++ b/src/syscall/mksyscall.pl
@@ -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"
diff --git a/src/syscall/zsyscall_darwin_amd64.go b/src/syscall/zsyscall_darwin_amd64.go
index 369f5a1702..07a519d7d6 100644
--- a/src/syscall/zsyscall_darwin_amd64.go
+++ b/src/syscall/zsyscall_darwin_amd64.go
@@ -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 {
diff --git a/src/syscall/zsyscall_darwin_arm64.go b/src/syscall/zsyscall_darwin_arm64.go
index 2185f324c1..5ae096730e 100644
--- a/src/syscall/zsyscall_darwin_arm64.go
+++ b/src/syscall/zsyscall_darwin_arm64.go
@@ -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 {