cmd/link: generate DIE for types referenced only through dictionaries

Generate debug_info entries for types that are only referenced through
dictionaries.

Change-Id: Ic36c2e6d9588ec6746793bb213c2dc0e17a8a850
Reviewed-on: https://go-review.googlesource.com/c/go/+/350532
Run-TryBot: Alessandro Arzilli <alessandro.arzilli@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Trust: Dan Scales <danscales@google.com>
Trust: David Chase <drchase@google.com>
This commit is contained in:
Alessandro Arzilli 2021-09-03 17:00:41 +02:00 committed by Than McIntosh
parent 6acac8b685
commit 6268468e02
6 changed files with 51 additions and 3 deletions

View file

@ -1209,6 +1209,15 @@ func (l *Loader) IsItab(i Sym) bool {
return r.Sym(li).IsItab()
}
// Returns whether this symbol is a dictionary symbol.
func (l *Loader) IsDict(i Sym) bool {
if l.IsExternal(i) {
return false
}
r, li := l.toLocal(i)
return r.Sym(li).IsDict()
}
// Return whether this is a trampoline of a deferreturn call.
func (l *Loader) IsDeferReturnTramp(i Sym) bool {
return l.deferReturnTramp[i]