aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/rt0_linux_arm64.s
diff options
context:
space:
mode:
authorFangming.Fang <fangming.fang@arm.com>2018-04-08 07:32:43 +0000
committerIan Lance Taylor <iant@golang.org>2018-05-02 17:52:14 +0000
commite8d417d272290027e10e348f81cbc6bb5fe0ec13 (patch)
tree394e28ae3d04021ddffc8c6c22d16abd71c1479f /src/runtime/rt0_linux_arm64.s
parenteff1e68528fc9052a7ff1ac7afe222696f85db8c (diff)
downloadgo-e8d417d272290027e10e348f81cbc6bb5fe0ec13.tar.gz
go-e8d417d272290027e10e348f81cbc6bb5fe0ec13.zip
runtime: enable memory sanitizer on arm64
Changes include: 1. open compilation option -msan for arm64 2. modify doc to explain -msan is also supported on linux/arm64 3. wrap msan lib API in msan_arm64.s 4. use libc for sigaction syscalls when cgo is enabled 5. use libc for mmap syscalls when cgo is enabled Change-Id: I26ebe61ff7ce1906125f54a0182a720f9d58ec11 Reviewed-on: https://go-review.googlesource.com/109255 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/rt0_linux_arm64.s')
-rw-r--r--src/runtime/rt0_linux_arm64.s7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/runtime/rt0_linux_arm64.s b/src/runtime/rt0_linux_arm64.s
index e81e598d3a..458f082159 100644
--- a/src/runtime/rt0_linux_arm64.s
+++ b/src/runtime/rt0_linux_arm64.s
@@ -11,7 +11,7 @@ TEXT _rt0_arm64_linux(SB),NOSPLIT|NOFRAME,$0
// When building with -buildmode=c-shared, this symbol is called when the shared
// library is loaded.
-TEXT _rt0_arm64_linux_lib(SB),NOSPLIT,$168
+TEXT _rt0_arm64_linux_lib(SB),NOSPLIT,$184
// Preserve callee-save registers.
MOVD R19, 24(RSP)
MOVD R20, 32(RSP)
@@ -30,6 +30,10 @@ TEXT _rt0_arm64_linux_lib(SB),NOSPLIT,$168
FMOVD F13, 136(RSP)
FMOVD F14, 144(RSP)
FMOVD F15, 152(RSP)
+ MOVD g, 160(RSP)
+
+ // Initialize g as null in case of using g later e.g. sigaction in cgo_sigaction.go
+ MOVD ZR, g
MOVD R0, _rt0_arm64_linux_lib_argc<>(SB)
MOVD R1, _rt0_arm64_linux_lib_argv<>(SB)
@@ -74,6 +78,7 @@ restore:
FMOVD 136(RSP), F13
FMOVD 144(RSP), F14
FMOVD 152(RSP), F15
+ MOVD 160(RSP), g
RET
TEXT _rt0_arm64_linux_lib_go(SB),NOSPLIT,$0