From: Than McIntosh Date: Tue, 10 Mar 2020 14:01:11 +0000 (-0400) Subject: [dev.link] cmd/link: fix up stray references to legacy "newdie" function X-Git-Tag: go1.15beta1~679^2~89 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=efbab6dc7dabde698aebb72d15bbf6708dec7be8;p=gostls13.git [dev.link] cmd/link: fix up stray references to legacy "newdie" function In a couple of places in the DWARF type generation code there were calls to the older sym.Symbol "newdie" funtion as opposed to the loader.Sym based method. This patch converts these to method calls. Change-Id: I202957464b7c37063ff74e834ed7b76d1dc5bcdf Reviewed-on: https://go-review.googlesource.com/c/go/+/222757 Reviewed-by: Cherry Zhang --- diff --git a/src/cmd/link/internal/ld/dwarf.go b/src/cmd/link/internal/ld/dwarf.go index 0d8c2acb95..b94e55fc2e 100644 --- a/src/cmd/link/internal/ld/dwarf.go +++ b/src/cmd/link/internal/ld/dwarf.go @@ -882,7 +882,7 @@ func (d *dwctxt2) synthesizemaptypes(ctxt *Link, die *dwarf.DWDie) { t = d.defptrto(keytype) } d.newrefattr(dwhk, dwarf.DW_AT_type, t) - fld := newdie(ctxt, dwhk, dwarf.DW_ABRV_ARRAYRANGE, "size", 0) + fld := d.newdie(dwhk, dwarf.DW_ABRV_ARRAYRANGE, "size", 0) newattr(fld, dwarf.DW_AT_count, dwarf.DW_CLS_CONSTANT, BucketSize, 0) d.newrefattr(fld, dwarf.DW_AT_type, d.uintptrInfoSym) }) @@ -896,7 +896,7 @@ func (d *dwctxt2) synthesizemaptypes(ctxt *Link, die *dwarf.DWDie) { t = d.defptrto(valtype) } d.newrefattr(dwhv, dwarf.DW_AT_type, t) - fld := newdie(ctxt, dwhv, dwarf.DW_ABRV_ARRAYRANGE, "size", 0) + fld := d.newdie(dwhv, dwarf.DW_ABRV_ARRAYRANGE, "size", 0) newattr(fld, dwarf.DW_AT_count, dwarf.DW_CLS_CONSTANT, BucketSize, 0) d.newrefattr(fld, dwarf.DW_AT_type, d.uintptrInfoSym) }) @@ -907,17 +907,17 @@ func (d *dwctxt2) synthesizemaptypes(ctxt *Link, die *dwarf.DWDie) { // bucket. "data" will be replaced with keys/values below. d.copychildrenexcept(ctxt, dwhb, bucket, findchild(bucket, "data")) - fld := newdie(ctxt, dwhb, dwarf.DW_ABRV_STRUCTFIELD, "keys", 0) + fld := d.newdie(dwhb, dwarf.DW_ABRV_STRUCTFIELD, "keys", 0) d.newrefattr(fld, dwarf.DW_AT_type, dwhks) newmemberoffsetattr(fld, BucketSize) - fld = newdie(ctxt, dwhb, dwarf.DW_ABRV_STRUCTFIELD, "values", 0) + fld = d.newdie(dwhb, dwarf.DW_ABRV_STRUCTFIELD, "values", 0) d.newrefattr(fld, dwarf.DW_AT_type, dwhvs) newmemberoffsetattr(fld, BucketSize+BucketSize*int32(keysize)) - fld = newdie(ctxt, dwhb, dwarf.DW_ABRV_STRUCTFIELD, "overflow", 0) + fld = d.newdie(dwhb, dwarf.DW_ABRV_STRUCTFIELD, "overflow", 0) d.newrefattr(fld, dwarf.DW_AT_type, d.defptrto(d.dtolsym(dwhb.Sym))) newmemberoffsetattr(fld, BucketSize+BucketSize*(int32(keysize)+int32(valsize))) if d.arch.RegSize > d.arch.PtrSize { - fld = newdie(ctxt, dwhb, dwarf.DW_ABRV_STRUCTFIELD, "pad", 0) + fld = d.newdie(dwhb, dwarf.DW_ABRV_STRUCTFIELD, "pad", 0) d.newrefattr(fld, dwarf.DW_AT_type, d.uintptrInfoSym) newmemberoffsetattr(fld, BucketSize+BucketSize*(int32(keysize)+int32(valsize))+int32(d.arch.PtrSize)) }