1
0
mirror of https://github.com/golang/go synced 2024-11-06 02:16:10 -07:00

[dev.link] cmd/link: fix up 'top frame' attribute in preload

Populate the 'top frame' attribute for function symbols during preload
(needed for DWARF debug frame generation).

Change-Id: If27836f51ebafa3c1c29b268a22d72d1b59b505a
Reviewed-on: https://go-review.googlesource.com/c/go/+/220983
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Than McIntosh 2020-02-19 09:44:23 -05:00
parent 48c79db07f
commit 3fd7d78dec

View File

@ -1627,6 +1627,9 @@ func (l *Loader) preloadSyms(r *oReader, kind int) {
if !added {
continue
}
if osym.TopFrame() {
l.SetAttrTopFrame(gi, true)
}
if strings.HasPrefix(name, "go.itablink.") {
l.itablink[gi] = struct{}{}
}
@ -2021,6 +2024,7 @@ func (l *Loader) migrateAttributes(src Sym, dst *sym.Symbol) {
dst.Attr.Set(sym.AttrOnList, l.AttrOnList(src))
dst.Attr.Set(sym.AttrLocal, l.AttrLocal(src))
dst.Attr.Set(sym.AttrNotInSymbolTable, l.AttrNotInSymbolTable(src))
dst.Attr.Set(sym.AttrNoSplit, l.IsNoSplit(src))
dst.Attr.Set(sym.AttrVisibilityHidden, l.AttrVisibilityHidden(src))
dst.Attr.Set(sym.AttrDuplicateOK, l.AttrDuplicateOK(src))
dst.Attr.Set(sym.AttrShared, l.AttrShared(src))