Remove sym.Symbol 'Unit' field, replacing accesses to the field with
calls into the loader instead.
Change-Id: Ia1abd4c3d93036705dd624a49cb3d9cbe6a5188b
Reviewed-on: https://go-review.googlesource.com/c/go/+/230307
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
case objabi.R_ADDRCUOFF:
// debug_range and debug_loc elements use this relocation type to get an
// offset from the start of the compile unit.
- o = Symaddr(r.Sym) + r.Add - Symaddr(ldr.Syms[r.Sym.Unit.Textp2[0]])
+ u := ldr.SymUnit(loader.Sym(r.Sym.SymIdx))
+ o = Symaddr(r.Sym) + r.Add - Symaddr(ldr.Syms[u.Textp2[0]])
// r->sym can be null when CALL $(constant) is transformed from absolute PC to relative PC call.
case objabi.R_GOTPCREL:
}
}
}
-
t = s.Type
}
s.Type = t
- s.Unit = unit
l.growSyms(int(i))
l.installSym(i, s)
return s
_32bit uintptr // size on 32bit platforms
_64bit uintptr // size on 64bit platforms
}{
- {Symbol{}, 96, 152},
+ {Symbol{}, 92, 144},
}
for _, tt := range tests {
SymIdx LoaderSym
auxinfo *AuxSymbol
Sect *Section
- Unit *CompilationUnit
// P contains the raw symbol data.
P []byte
R []Reloc