mirror of
https://github.com/golang/go.git
synced 2025-05-18 22:04:38 +00:00
runtime: fix cgo export of panicmem on ios
CL 68490 reworked the way the panicmem function is exposed to the C mach expection catcher. However, //go:cgo_export_static isn't enough: the underlying assembly functions must not start with the middle dot. Without the middle dot, the panicmem function's exported name is not prefixed with its package; rename it to xx_cgo_panicmem to decrease the chance of a symbol name clash. Finally, mark the overridden C symbol weak to avoid duplicate symbol errors from the host linker. For the ios builders. Change-Id: Ib87789fecec9314e398cf1bd8c04ba0b3a6642af Reviewed-on: https://go-review.googlesource.com/69113 Run-TryBot: Elias Naur <elias.naur@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
bb0bfd002a
commit
ae175f74cb
@ -5,10 +5,4 @@ runtime/sys_darwin_arm64.s: [arm64] sigtramp: 24(RSP) should be infostyle+8(FP)
|
|||||||
runtime/sys_darwin_arm64.s: [arm64] bsdthread_create: RET without writing to 4-byte ret+24(FP)
|
runtime/sys_darwin_arm64.s: [arm64] bsdthread_create: RET without writing to 4-byte ret+24(FP)
|
||||||
runtime/sys_darwin_arm64.s: [arm64] bsdthread_start: function bsdthread_start missing Go declaration
|
runtime/sys_darwin_arm64.s: [arm64] bsdthread_start: function bsdthread_start missing Go declaration
|
||||||
runtime/sys_darwin_arm64.s: [arm64] bsdthread_register: RET without writing to 4-byte ret+0(FP)
|
runtime/sys_darwin_arm64.s: [arm64] bsdthread_register: RET without writing to 4-byte ret+0(FP)
|
||||||
runtime/cgo/signal_darwin_arm64.s: [arm64] panicmem: use of 8(RSP) points beyond argument frame
|
|
||||||
runtime/cgo/signal_darwin_arm64.s: [arm64] panicmem: use of 8(RSP) points beyond argument frame
|
|
||||||
runtime/cgo/signal_darwin_arm64.s: [arm64] panicmem: use of 16(RSP) points beyond argument frame
|
|
||||||
runtime/cgo/signal_darwin_arm64.s: [arm64] panicmem: use of 8(RSP) points beyond argument frame
|
|
||||||
runtime/cgo/signal_darwin_arm64.s: [arm64] panicmem: use of 16(RSP) points beyond argument frame
|
|
||||||
runtime/cgo/signal_darwin_arm64.s: [arm64] panicmem: use of 16(RSP) points beyond argument frame
|
|
||||||
runtime/asm_arm64.s: [arm64] sigreturn: function sigreturn missing Go declaration
|
runtime/asm_arm64.s: [arm64] sigreturn: function sigreturn missing Go declaration
|
||||||
|
@ -10,4 +10,4 @@
|
|||||||
// We hope that for real binaries the definition provided by Go will take precedence
|
// We hope that for real binaries the definition provided by Go will take precedence
|
||||||
// and the linker will drop this .o file altogether, which is why this definition
|
// and the linker will drop this .o file altogether, which is why this definition
|
||||||
// is all by itself in its own file.
|
// is all by itself in its own file.
|
||||||
void xx_cgo_panicmem(void) {}
|
void __attribute__((weak)) xx_cgo_panicmem(void) {}
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
// panicmem is the entrypoint for SIGSEGV as intercepted via a
|
// xx_cgo_panicmem is the entrypoint for SIGSEGV as intercepted via a
|
||||||
// mach thread port as EXC_BAD_ACCESS. As the segfault may have happened
|
// mach thread port as EXC_BAD_ACCESS. As the segfault may have happened
|
||||||
// in C code, we first need to load_g then call panicmem.
|
// in C code, we first need to load_g then call xx_cgo_panicmem.
|
||||||
//
|
//
|
||||||
// R1 - LR at moment of fault
|
// R1 - LR at moment of fault
|
||||||
// R2 - PC at moment of fault
|
// R2 - PC at moment of fault
|
||||||
TEXT ·panicmem(SB),NOSPLIT,$-4
|
TEXT xx_cgo_panicmem(SB),NOSPLIT,$-4
|
||||||
// If in external C code, we need to load the g register.
|
// If in external C code, we need to load the g register.
|
||||||
BL runtime·load_g(SB)
|
BL runtime·load_g(SB)
|
||||||
CMP $0, g
|
CMP $0, g
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
// panicmem is the entrypoint for SIGSEGV as intercepted via a
|
// xx_cgo_panicmem is the entrypoint for SIGSEGV as intercepted via a
|
||||||
// mach thread port as EXC_BAD_ACCESS. As the segfault may have happened
|
// mach thread port as EXC_BAD_ACCESS. As the segfault may have happened
|
||||||
// in C code, we first need to load_g then call panicmem.
|
// in C code, we first need to load_g then call xx_cgo_panicmem.
|
||||||
//
|
//
|
||||||
// R1 - LR at moment of fault
|
// R1 - LR at moment of fault
|
||||||
// R2 - PC at moment of fault
|
// R2 - PC at moment of fault
|
||||||
TEXT ·panicmem(SB),NOSPLIT,$-8
|
TEXT xx_cgo_panicmem(SB),NOSPLIT,$-8
|
||||||
// If in external C code, we need to load the g register.
|
// If in external C code, we need to load the g register.
|
||||||
BL runtime·load_g(SB)
|
BL runtime·load_g(SB)
|
||||||
CMP $0, g
|
CMP $0, g
|
||||||
|
@ -9,5 +9,5 @@ package cgo
|
|||||||
|
|
||||||
import _ "unsafe"
|
import _ "unsafe"
|
||||||
|
|
||||||
//go:cgo_export_static panicmem xx_cgo_panicmem
|
//go:cgo_export_static xx_cgo_panicmem xx_cgo_panicmem
|
||||||
func panicmem()
|
func xx_cgo_panicmem()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user