aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/rt0_linux_386.s
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2015-12-26 09:51:59 -0800
committerIan Lance Taylor <iant@golang.org>2016-01-09 00:58:38 +0000
commit21b4f234c716cb35ca0c7e02f81b760cce8f7f37 (patch)
tree93365efee4bf6a668719d304603e519a492c4e74 /src/runtime/rt0_linux_386.s
parent0b3807a2a370a55e06040cafa85a76b90d06eb6f (diff)
downloadgo-21b4f234c716cb35ca0c7e02f81b760cce8f7f37.tar.xz
runtime: for c-archive/c-shared, install signal handlers synchronously
The previous behaviour of installing the signal handlers in a separate thread meant that Go initialization raced with non-Go initialization if the non-Go initialization also wanted to install signal handlers. Make installing signal handlers synchronous so that the process-wide behavior is predictable. Update #9896. Change-Id: Ice24299877ec46f8518b072a381932d273096a32 Reviewed-on: https://go-review.googlesource.com/18150 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/runtime/rt0_linux_386.s')
-rw-r--r--src/runtime/rt0_linux_386.s4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/rt0_linux_386.s b/src/runtime/rt0_linux_386.s
index 633e8069df..59a30b41e8 100644
--- a/src/runtime/rt0_linux_386.s
+++ b/src/runtime/rt0_linux_386.s
@@ -26,6 +26,10 @@ TEXT _rt0_386_linux_lib(SB),NOSPLIT,$0
MOVL 12(BP), AX
MOVL AX, _rt0_386_linux_lib_argv<>(SB)
+ // Synchronous initialization.
+ MOVL $runtimeĀ·libpreinit(SB), AX
+ CALL AX
+
SUBL $8, SP
// Create a new thread to do the runtime initialization.