mirror of https://github.com/golang/go.git
cmd/link: do not mark go.plugin.tabs as reachable in non-plugins
Fixes #18250 Change-Id: I4f61591356ddb4a906c206ad8456d1839daf7b91 Reviewed-on: https://go-review.googlesource.com/34170 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
291254414b
commit
67b2927990
|
|
@ -7,6 +7,11 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Having a function declared in the main package triggered
|
||||||
|
// golang.org/issue/18250
|
||||||
|
func DeclaredInMain() {
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
defer depBase.ImplementedInAsm()
|
defer depBase.ImplementedInAsm()
|
||||||
// This code below causes various go.itab.* symbols to be generated in
|
// This code below causes various go.itab.* symbols to be generated in
|
||||||
|
|
|
||||||
|
|
@ -602,8 +602,7 @@ func (ctxt *Link) symtab() {
|
||||||
adduint(ctxt, moduledata, uint64(nitablinks))
|
adduint(ctxt, moduledata, uint64(nitablinks))
|
||||||
adduint(ctxt, moduledata, uint64(nitablinks))
|
adduint(ctxt, moduledata, uint64(nitablinks))
|
||||||
// The ptab slice
|
// The ptab slice
|
||||||
if ptab := ctxt.Syms.ROLookup("go.plugin.tabs", 0); ptab != nil {
|
if ptab := ctxt.Syms.ROLookup("go.plugin.tabs", 0); ptab != nil && ptab.Attr.Reachable() {
|
||||||
ptab.Attr |= AttrReachable
|
|
||||||
ptab.Attr |= AttrLocal
|
ptab.Attr |= AttrLocal
|
||||||
ptab.Type = obj.SRODATA
|
ptab.Type = obj.SRODATA
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue