aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-12-01 05:47:58 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-12-01 05:47:58 +0000
commit08106b9fc73945d6f7e422530eec636138b19e3e (patch)
treee58c2df7e7df5f0dc66335b432241c685482b0c3 /libgo
parent7b69e9fc3fd83fd30d2540c8e5e6e0a1f6cfa4e6 (diff)
runtime: set isarchive in initsig
The library initialization code in go-libmain.c sets the C variable runtime_isarchive but failed to set the Go variable runtime.isarchive. We don't currently have a way to let C code access an unexported Go variable, but fortunately the only time the Go function initsig is called with an argument of true is exactly where we want to set isarchive. So let initsig do it. Reviewed-on: https://go-review.googlesource.com/33753 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243094 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/runtime/signal1_unix.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libgo/go/runtime/signal1_unix.go b/libgo/go/runtime/signal1_unix.go
index d21bf4c31d7..48c549104c4 100644
--- a/libgo/go/runtime/signal1_unix.go
+++ b/libgo/go/runtime/signal1_unix.go
@@ -65,6 +65,11 @@ var signalsOK bool
//go:nosplit
//go:nowritebarrierrec
func initsig(preinit bool) {
+ if preinit {
+ // preinit is only passed as true if isarchive should be true.
+ isarchive = true
+ }
+
if !preinit {
// It's now OK for signal handlers to run.
signalsOK = true