From 3fd7d78decf9e4770083c5e0dddc878ab278a464 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Wed, 19 Feb 2020 09:44:23 -0500 Subject: [PATCH] [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 TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/cmd/link/internal/loader/loader.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go index d5b1b97be1..bf7e314977 100644 --- a/src/cmd/link/internal/loader/loader.go +++ b/src/cmd/link/internal/loader/loader.go @@ -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))