Commit f797e485 authored by Hiroshi Ioka's avatar Hiroshi Ioka Committed by David Crawshaw

cmd/link: don't generate runtime.text twice for buildmode=plugin on darwin

https://golang.org/cl/29394 changed to include runtime.text and
runtime.etext in ctxt.Textp as a work around.
But it seems that the CL forgot to change genasmsym.
As a result, we are generating runtime.text and runtime.etext twice.

Change-Id: If7f8faf496c1c489ffa4804da712f91a3d3f4be4
Reviewed-on: https://go-review.googlesource.com/62810Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e27a8122
......@@ -1939,7 +1939,12 @@ func genasmsym(ctxt *Link, put func(*Link, *Symbol, string, SymbolType, int64, *
// skip STEXT symbols. Normal STEXT symbols are emitted by walking textp.
s := ctxt.Syms.Lookup("runtime.text", 0)
if s.Type == STEXT {
put(ctxt, s, s.Name, TextSym, s.Value, nil)
// We've already included this symbol in ctxt.Textp
// if ctxt.DynlinkingGo() && Headtype == objabi.Hdarwin.
// See data.go:/textaddress
if !(ctxt.DynlinkingGo() && Headtype == objabi.Hdarwin) {
put(ctxt, s, s.Name, TextSym, s.Value, nil)
}
}
n := 0
......@@ -1965,7 +1970,12 @@ func genasmsym(ctxt *Link, put func(*Link, *Symbol, string, SymbolType, int64, *
s = ctxt.Syms.Lookup("runtime.etext", 0)
if s.Type == STEXT {
put(ctxt, s, s.Name, TextSym, s.Value, nil)
// We've already included this symbol in ctxt.Textp
// if ctxt.DynlinkingGo() && Headtype == objabi.Hdarwin.
// See data.go:/textaddress
if !(ctxt.DynlinkingGo() && Headtype == objabi.Hdarwin) {
put(ctxt, s, s.Name, TextSym, s.Value, nil)
}
}
for _, s := range ctxt.Syms.Allsym {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment