reason=fmt.Sprintf("new length %d != old length %d",len(p),len(pdup))
}
fmt.Fprintf(os.Stderr,"cmd/link: while reading object for '%v': duplicate symbol '%s', previous def at '%v', with mismatched payload: %s\n",r.unit.Lib,name,rdup.unit.Lib,reason)
// For the moment, whitelist DWARF subprogram DIEs for
// auto-generated wrapper functions. What seems to happen
// here is that we get different line numbers on formal
// params; I am guessing that the pos is being inherited
// TODO: do something? External symbols have different representation of attributes. For now, ReflectMethod is the only thing matters and it cannot be set by external symbol.
return0
}
r,li:=l.toLocal(i)
osym:=goobj2.Sym{}
osym.Read(r.Reader,r.SymOff(li))
returnosym.Flag
}
// Returns whether the i-th symbol has ReflectMethod attribute set.
func(l*Loader)IsReflectMethod(iSym)bool{
returnl.SymAttr(i)&goobj2.SymFlagReflectMethod!=0
}
// Returns whether this is a Go type symbol.
func(l*Loader)IsGoType(iSym)bool{
returnl.SymAttr(i)&goobj2.SymFlagGoType!=0
}
// Returns whether this is a "go.itablink.*" symbol.
func(l*Loader)IsItabLink(iSym)bool{
if_,ok:=l.itablink[i];ok{
returntrue
}
returnfalse
}
// Returns the symbol content of the i-th symbol. i is global index.
func(l*Loader)Data(iSym)[]byte{
ifl.IsExternal(i){
ifs:=l.Syms[i];s!=nil{
returns.P
}
returnnil
}
r,li:=l.toLocal(i)
returnr.Data(li)
}
// Returns the number of aux symbols given a global index.
func(l*Loader)NAux(iSym)int{
ifl.IsExternal(i){
return0
}
r,li:=l.toLocal(i)
returnr.NAux(li)
}
// Returns the referred symbol of the j-th aux symbol of the i-th
// symbol.
func(l*Loader)AuxSym(iSym,jint)Sym{
ifl.IsExternal(i){
return0
}
r,li:=l.toLocal(i)
a:=goobj2.Aux{}
a.Read(r.Reader,r.AuxOff(li,j))
returnl.resolve(r,a.Sym)
}
// ReadAuxSyms reads the aux symbol ids for the specified symbol into the
// slice passed as a parameter. If the slice capacity is not large enough, a new
// larger slice will be allocated. Final slice is returned.