diff options
| author | Fangming.Fang <fangming.fang@arm.com> | 2018-04-08 07:32:43 +0000 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2018-05-02 17:52:14 +0000 |
| commit | e8d417d272290027e10e348f81cbc6bb5fe0ec13 (patch) | |
| tree | 394e28ae3d04021ddffc8c6c22d16abd71c1479f /src/runtime/sys_linux_arm64.s | |
| parent | eff1e68528fc9052a7ff1ac7afe222696f85db8c (diff) | |
| download | go-e8d417d272290027e10e348f81cbc6bb5fe0ec13.tar.xz | |
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/sys_linux_arm64.s')
| -rw-r--r-- | src/runtime/sys_linux_arm64.s | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/runtime/sys_linux_arm64.s b/src/runtime/sys_linux_arm64.s index f930d1f044..c6afd76a65 100644 --- a/src/runtime/sys_linux_arm64.s +++ b/src/runtime/sys_linux_arm64.s @@ -292,6 +292,16 @@ TEXT runtime·rt_sigaction(SB),NOSPLIT|NOFRAME,$0-36 MOVW R0, ret+32(FP) RET +// Call the function stored in _cgo_sigaction using the GCC calling convention. +TEXT runtime·callCgoSigaction(SB),NOSPLIT,$0 + MOVD sig+0(FP), R0 + MOVD new+8(FP), R1 + MOVD old+16(FP), R2 + MOVD _cgo_sigaction(SB), R3 + BL R3 + MOVW R0, ret+24(FP) + RET + TEXT runtime·sigfwd(SB),NOSPLIT,$0-32 MOVW sig+8(FP), R0 MOVD info+16(FP), R1 @@ -320,7 +330,7 @@ TEXT runtime·cgoSigtramp(SB),NOSPLIT,$0 MOVD $runtime·sigtramp(SB), R3 B (R3) -TEXT runtime·mmap(SB),NOSPLIT|NOFRAME,$0 +TEXT runtime·sysMmap(SB),NOSPLIT|NOFRAME,$0 MOVD addr+0(FP), R0 MOVD n+8(FP), R1 MOVW prot+16(FP), R2 @@ -341,7 +351,21 @@ ok: MOVD $0, err+40(FP) RET -TEXT runtime·munmap(SB),NOSPLIT|NOFRAME,$0 +// Call the function stored in _cgo_mmap using the GCC calling convention. +// This must be called on the system stack. +TEXT runtime·callCgoMmap(SB),NOSPLIT,$0 + MOVD addr+0(FP), R0 + MOVD n+8(FP), R1 + MOVW prot+16(FP), R2 + MOVW flags+20(FP), R3 + MOVW fd+24(FP), R4 + MOVW off+28(FP), R5 + MOVD _cgo_mmap(SB), R9 + BL R9 + MOVD R0, ret+32(FP) + RET + +TEXT runtime·sysMunmap(SB),NOSPLIT|NOFRAME,$0 MOVD addr+0(FP), R0 MOVD n+8(FP), R1 MOVD $SYS_munmap, R8 @@ -352,6 +376,15 @@ TEXT runtime·munmap(SB),NOSPLIT|NOFRAME,$0 cool: RET +// Call the function stored in _cgo_munmap using the GCC calling convention. +// This must be called on the system stack. +TEXT runtime·callCgoMunmap(SB),NOSPLIT,$0 + MOVD addr+0(FP), R0 + MOVD n+8(FP), R1 + MOVD _cgo_munmap(SB), R9 + BL R9 + RET + TEXT runtime·madvise(SB),NOSPLIT|NOFRAME,$0 MOVD addr+0(FP), R0 MOVD n+8(FP), R1 |
