diff --git a/src/cmd/link/internal/ld/dwarf.go b/src/cmd/link/internal/ld/dwarf.go index d10f4ab3c3ca14..a150306df9174d 100644 --- a/src/cmd/link/internal/ld/dwarf.go +++ b/src/cmd/link/internal/ld/dwarf.go @@ -1219,11 +1219,14 @@ func writelines(ctxt *Link, unit *compilationUnit, ls *sym.Symbol) { pciterinit(ctxt, &pcfile, &s.FuncInfo.Pcfile) pciterinit(ctxt, &pcline, &s.FuncInfo.Pcline) - pciterinit(ctxt, &pcstmt, &sym.Pcdata{P: s.FuncInfo.IsStmtSym.P}) - if pcstmt.done != 0 { + isStmtSym := dwarfFuncSym(ctxt, s, dwarf.IsStmtPrefix, false) + if isStmtSym != nil && len(isStmtSym.P) > 0 { + pciterinit(ctxt, &pcstmt, &sym.Pcdata{P: isStmtSym.P}) + } else { // Assembly files lack a pcstmt section, we assume that every instruction // is a valid statement. + pcstmt.done = 1 pcstmt.value = 1 } diff --git a/src/cmd/link/internal/objfile/objfile.go b/src/cmd/link/internal/objfile/objfile.go index 77c3a7f9148c40..a85ba1ebee95be 100644 --- a/src/cmd/link/internal/objfile/objfile.go +++ b/src/cmd/link/internal/objfile/objfile.go @@ -320,8 +320,6 @@ overwrite: pc.InlTree[i].Func = r.readSymIndex() } - s.FuncInfo.IsStmtSym = r.syms.Lookup(dwarf.IsStmtPrefix+s.Name, int(s.Version)) - if !dupok { if s.Attr.OnList() { log.Fatalf("symbol %s listed multiple times", s.Name) diff --git a/src/cmd/link/internal/sym/symbol.go b/src/cmd/link/internal/sym/symbol.go index 5e5fca467da2e8..a1af4670a28b55 100644 --- a/src/cmd/link/internal/sym/symbol.go +++ b/src/cmd/link/internal/sym/symbol.go @@ -499,7 +499,6 @@ type FuncInfo struct { Pcline Pcdata Pcinline Pcdata Pcdata []Pcdata - IsStmtSym *Symbol Funcdata []*Symbol Funcdataoff []int64 File []*Symbol