diff --git a/ld.go b/ld.go index daba388d..fe4dd2cb 100644 --- a/ld.go +++ b/ld.go @@ -308,22 +308,24 @@ func (linker *Linker) readFuncData(symbol *obj.ObjSymbol, codeLen int) (err erro } for _, name := range symbol.Func.FuncData { - if _, ok := linker.symMap[name]; !ok { - if _, ok := linker.objsymbolMap[name]; ok { - if _, err = linker.addSymbol(name); err != nil { - return err + if name == EmptyString { + Func.FuncData = append(Func.FuncData, (uintptr)(0)) + } else { + if _, ok := linker.symMap[name]; !ok { + if _, ok := linker.objsymbolMap[name]; ok { + if _, err = linker.addSymbol(name); err != nil { + return err + } + } else { + return errors.New("unknown gcobj:" + name) } - } else if len(name) == 0 { - //nothing todo + } + if sym, ok := linker.symMap[name]; ok { + Func.FuncData = append(Func.FuncData, (uintptr)(sym.Offset)) } else { - return errors.New("unknown gcobj:" + name) + Func.FuncData = append(Func.FuncData, (uintptr)(0)) } } - if sym, ok := linker.symMap[name]; ok { - Func.FuncData = append(Func.FuncData, (uintptr)(sym.Offset)) - } else { - Func.FuncData = append(Func.FuncData, (uintptr)(0)) - } } if err = linker.addInlineTree(&_func, symbol); err != nil {