func reversetree(list **dwarf.DWDie) { reverselist(list) for die := *list; die != nil; die = die.Link { if dwarf.HasChildren(die) { reversetree(&die.Child) } } }
func putdie(linkctxt *Link, ctxt dwarf.Context, syms []*Symbol, die *dwarf.DWDie) []*Symbol { s := dtolsym(die.Sym) if s == nil { s = syms[len(syms)-1] } else { if s.Attr.OnList() { log.Fatalf("symbol %s listed multiple times", s.Name) } s.Attr |= AttrOnList syms = append(syms, s) } dwarf.Uleb128put(ctxt, s, int64(die.Abbrev)) dwarf.PutAttrs(ctxt, s, die.Abbrev, die.Attr) if dwarf.HasChildren(die) { return putdies(linkctxt, ctxt, syms, die.Child) } return syms }