Lines Matching full:ctxt
24 ctxt *Link
80 func newObjWriter(ctxt *Link, b *bufio.Writer) *objWriter {
82 ctxt: ctxt,
89 func WriteObjFile(ctxt *Link, b *bufio.Writer) {
90 w := newObjWriter(ctxt, b)
99 for _, pkg := range ctxt.Imports {
105 for _, s := range ctxt.Text {
109 for _, s := range ctxt.Data {
120 for _, s := range ctxt.Text {
131 for _, s := range ctxt.Data {
135 ctxt.Diag("cannot provide data for %v sym %v", s.Type, s.Name)
142 for _, s := range ctxt.Text {
145 for _, s := range ctxt.Data {
205 fsym := w.ctxt.Lookup(f)
210 f, _ := linkgetlineFromPos(w.ctxt, call.Pos)
211 fsym := w.ctxt.Lookup(f)
218 ctxt := w.ctxt
219 fmt.Fprintf(ctxt.Bso, "%s ", s.Name)
221 fmt.Fprintf(ctxt.Bso, "%v ", s.Type)
224 fmt.Fprint(ctxt.Bso, "static ")
227 fmt.Fprintf(ctxt.Bso, "dupok ")
230 fmt.Fprintf(ctxt.Bso, "cfunc ")
233 fmt.Fprintf(ctxt.Bso, "nosplit ")
235 fmt.Fprintf(ctxt.Bso, "size=%d", s.Size)
237 fmt.Fprintf(ctxt.Bso, " args=%#x locals=%#x", uint64(s.Func.Args), uint64(s.Func.Locals))
239 fmt.Fprintf(ctxt.Bso, " leaf")
242 fmt.Fprintf(ctxt.Bso, "\n")
245 fmt.Fprintf(ctxt.Bso, "\t%#04x %v\n", uint(int(p.Pc)), p)
249 fmt.Fprintf(ctxt.Bso, "\t%#04x", uint(i))
252 fmt.Fprintf(ctxt.Bso, " %02x", s.P[j])
255 fmt.Fprintf(ctxt.Bso, " ")
257 fmt.Fprintf(ctxt.Bso, " ")
261 fmt.Fprintf(ctxt.Bso, "%c", c)
263 fmt.Fprintf(ctxt.Bso, ".")
267 fmt.Fprintf(ctxt.Bso, "\n")
278 if ctxt.Arch.InFamily(sys.ARM, sys.PPC64) {
279 fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%x\n", int(r.Off), r.Siz, r.Type, name, uint64(r.Add))
281 fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type, name, r.Add)
287 ctxt := w.ctxt
288 if ctxt.Debugasm {
342 if ctxt.Flag_shared {
380 fsym := ctxt.Lookup(f)
386 f, l := linkgetlineFromPos(w.ctxt, call.Pos)
387 fsym := ctxt.Lookup(f)
505 func (ctxt *Link) dwarfSym(s *LSym) (dwarfInfoSym, dwarfLocSym, dwarfRangesSym, dwarfAbsFnSym *LSym) {
507 ctxt.Diag("dwarfSym of non-TEXT %v", s)
510 s.Func.dwarfInfoSym = ctxt.LookupDerived(s, dwarf.InfoPrefix+s.Name)
511 if ctxt.Flag_locationlists {
512 s.Func.dwarfLocSym = ctxt.LookupDerived(s, dwarf.LocPrefix+s.Name)
514 s.Func.dwarfRangesSym = ctxt.LookupDerived(s, dwarf.RangePrefix+s.Name)
516 s.Func.dwarfAbsFnSym = ctxt.DwFixups.AbsFuncDwarfSym(s)
530 func (ctxt *Link) fileSymbol(fn *LSym) *LSym {
533 f, _ := linkgetlineFromPos(ctxt, p.Pos)
534 fsym := ctxt.Lookup(f)
543 func (ctxt *Link) populateDWARF(curfn interface{}, s *LSym, myimportpath string) {
544 info, loc, ranges, absfunc := ctxt.dwarfSym(s)
546 ctxt.Diag("makeFuncDebugEntry double process %v", s)
550 if ctxt.DebugInfo != nil {
551 scopes, inlcalls = ctxt.DebugInfo(s, curfn)
554 dwctxt := dwCtxt{ctxt}
555 filesym := ctxt.fileSymbol(s)
573 ctxt.Diag("emitting DWARF for %s failed: %v", s.Name, err)
580 ctxt.Diag("emitting DWARF for %s failed: %v", s.Name, err)
586 func (ctxt *Link) DwarfIntConst(myimportpath, name, typename string, val int64) {
590 s := ctxt.LookupInit(dwarf.ConstInfoPrefix+myimportpath, func(s *LSym) {
592 ctxt.Data = append(ctxt.Data, s)
594 dwarf.PutIntConst(dwCtxt{ctxt}, s, ctxt.Lookup(dwarf.InfoPrefix+typename), myimportpath+"."+name, val)
597 func (ctxt *Link) DwarfAbstractFunc(curfn interface{}, s *LSym, myimportpath string) {
598 absfn := ctxt.DwFixups.AbsFuncDwarfSym(s)
600 ctxt.Diag("internal error: DwarfAbstractFunc double process %v", s)
605 scopes, _ := ctxt.DebugInfo(s, curfn)
606 dwctxt := dwCtxt{ctxt}
607 filesym := ctxt.fileSymbol(s)
618 ctxt.Diag("emitting DWARF for %s failed: %v", s.Name, err)
657 ctxt *Link
691 func NewDwarfFixupTable(ctxt *Link) *DwarfFixupTable {
693 ctxt: ctxt,
708 ft.ctxt.Diag("internal error: DwarfFixupTable.SetPrecursorFunc double call on %v", s)
714 absfn := ft.ctxt.LookupDerived(s, dwarf.InfoPrefix+s.Name+dwarf.AbstractFuncSuffix)
717 ft.ctxt.Data = append(ft.ctxt.Data, absfn)
751 ft.ctxt.Diag("internal error: DwarfFixupTable.ReferenceChildDIE unable to locate child DIE offset for dclIdx=%d src=%v tgt=%v", dclidx, s, tgt)
766 ft.ctxt.Diag("internal error: RegisterChildDIEOffsets vars/offsets length mismatch")
805 ft.ctxt.Diag("internal error: DwarfFixupTable has orphaned fixup on %v targeting %v relidx=%d dclidx=%d", f.refsym, s, f.relidx, f.dclidx)
820 ft.ctxt.Diag("internal error: AbsFuncDwarfSym requested for %v, not seen during inlining", fnsym)
832 ft.ctxt.Logf("DwarfFixupTable.Finalize invoked for %s\n", myimportpath)
846 if ft.ctxt.InParallel {
847 ft.ctxt.Diag("internal error: DwarfFixupTable.Finalize call during parallel backend")
856 ft.ctxt.GenAbstractFunc(s)
866 ft.ctxt.Diag("internal error: DwarfFixupTable.Finalize orphan abstract function for %v", s)