diff options
| author | Cherry Zhang <cherryyz@google.com> | 2017-03-23 22:47:56 -0400 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2017-03-24 15:37:56 +0000 |
| commit | 3a1ce1085ad08296557e8a87573fae4634ce7d8e (patch) | |
| tree | 5b0391e8e96fad3998dfcf6156eb50a989eef93a /src/runtime/proc.go | |
| parent | 48de5a85fbc452bfc3af7422cd8aba0fab132d3d (diff) | |
| download | go-3a1ce1085ad08296557e8a87573fae4634ce7d8e.tar.xz | |
runtime: access _cgo_yield indirectly
The darwin linker for ARM does not allow PC-relative relocation
of external symbol in text section. Work around it by accessing
it indirectly: putting its address in a global variable (which is
not external), and accessing through that variable.
Fixes #19684.
Change-Id: I41361bbb281b5dbdda0d100ae49d32c69ed85a81
Reviewed-on: https://go-review.googlesource.com/38596
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Elias Naur <elias.naur@gmail.com>
Diffstat (limited to 'src/runtime/proc.go')
| -rw-r--r-- | src/runtime/proc.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 159a9bd4bc..8dede3fb23 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -1903,8 +1903,8 @@ top: ready(gp, 0, true) } } - if _cgo_yield != nil { - asmcgocall(_cgo_yield, nil) + if *cgo_yield != nil { + asmcgocall(*cgo_yield, nil) } // local runq @@ -3760,8 +3760,8 @@ func sysmon() { unlock(&sched.lock) } // trigger libc interceptors if needed - if _cgo_yield != nil { - asmcgocall(_cgo_yield, nil) + if *cgo_yield != nil { + asmcgocall(*cgo_yield, nil) } // poll network if not polled for more than 10ms lastpoll := int64(atomic.Load64(&sched.lastpoll)) |
