aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/sym.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/internal/obj/sym.go')
-rw-r--r--src/cmd/internal/obj/sym.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cmd/internal/obj/sym.go b/src/cmd/internal/obj/sym.go
index d58877ee15..4515bdd0d3 100644
--- a/src/cmd/internal/obj/sym.go
+++ b/src/cmd/internal/obj/sym.go
@@ -38,6 +38,7 @@ import (
"log"
"math"
"sort"
+ "strings"
)
func Linknew(arch *LinkArch) *Link {
@@ -204,7 +205,9 @@ func (ctxt *Link) NumberSyms() {
// if Pkgpath is unknown, cannot hash symbols with relocations, as it
// may reference named symbols whose names are not fully expanded.
if s.ContentAddressable() && (ctxt.Pkgpath != "" || len(s.R) == 0) {
- if len(s.P) <= 8 && len(s.R) == 0 { // we can use short hash only for symbols without relocations
+ if s.Size <= 8 && len(s.R) == 0 && !strings.HasPrefix(s.Name, "type.") {
+ // We can use short hash only for symbols without relocations.
+ // Don't use short hash for type symbols, as they need special handling.
s.PkgIdx = goobj.PkgIdxHashed64
s.SymIdx = hashed64idx
if hashed64idx != int32(len(ctxt.hashed64defs)) {
@@ -355,7 +358,8 @@ func (ctxt *Link) traverseSyms(flag traverseFlag, fn func(*LSym)) {
}
func (ctxt *Link) traverseFuncAux(flag traverseFlag, fsym *LSym, fn func(parent *LSym, aux *LSym)) {
- pc := &fsym.Func.Pcln
+ fninfo := fsym.Func()
+ pc := &fninfo.Pcln
if flag&traverseAux == 0 {
// NB: should it become necessary to walk aux sym reloc references
// without walking the aux syms themselves, this can be changed.
@@ -386,7 +390,8 @@ func (ctxt *Link) traverseFuncAux(flag traverseFlag, fsym *LSym, fn func(parent
fn(fsym, filesym)
}
}
- dwsyms := []*LSym{fsym.Func.dwarfRangesSym, fsym.Func.dwarfLocSym, fsym.Func.dwarfDebugLinesSym, fsym.Func.dwarfInfoSym}
+
+ dwsyms := []*LSym{fninfo.dwarfRangesSym, fninfo.dwarfLocSym, fninfo.dwarfDebugLinesSym, fninfo.dwarfInfoSym}
for _, dws := range dwsyms {
if dws == nil || dws.Size == 0 {
continue