aboutsummaryrefslogtreecommitdiff
path: root/misc/cgo/testplugin/src/plugin1/plugin1.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@golang.org>2016-12-09 12:38:34 -0500
committerDavid Crawshaw <crawshaw@golang.org>2016-12-10 17:03:45 +0000
commitab5a2173f91c1e2779cdf49a2fc8a7abafecd5f1 (patch)
tree8d8af0f1466eb48eb0b493537b2e3c5a16aa3566 /misc/cgo/testplugin/src/plugin1/plugin1.go
parent4c71af71b43f8fcface5f63cdb3620203b58d45e (diff)
downloadgo-ab5a2173f91c1e2779cdf49a2fc8a7abafecd5f1.tar.xz
cmd/link: limit darwin dynlink symbol exports
The pclntable contains pointers to functions. If the function symbol is exported in a plugin, and there is a matching symbol in the host binary, then the pclntable of a plugin ends up pointing at the function in the host module. This doesn't work because the traceback code expects the pointer to be in the same module space as the PC value. So don't export functions that might overlap with the host binary. This way the pointer stays in its module. Updates #18190 Change-Id: Ifb77605b35fb0a1e7edeecfd22b1e335ed4bb392 Reviewed-on: https://go-review.googlesource.com/34196 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'misc/cgo/testplugin/src/plugin1/plugin1.go')
-rw-r--r--misc/cgo/testplugin/src/plugin1/plugin1.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/misc/cgo/testplugin/src/plugin1/plugin1.go b/misc/cgo/testplugin/src/plugin1/plugin1.go
index 7a62242134..edcef2c77e 100644
--- a/misc/cgo/testplugin/src/plugin1/plugin1.go
+++ b/misc/cgo/testplugin/src/plugin1/plugin1.go
@@ -9,7 +9,10 @@ import "C"
import "common"
-func F() int { return 3 }
+func F() int {
+ _ = make([]byte, 1<<21) // trigger stack unwind, Issue #18190.
+ return 3
+}
func ReadCommonX() int {
return common.X