// Assembling the binary is broken into two steps: // - writing out the code/data/dwarf Segments, applying relocations on the fly // - writing out the architecture specific pieces. // // This function handles the first part. func asmb(ctxt *Link) { … } // Assembling the binary is broken into two steps: // - writing out the code/data/dwarf Segments // - writing out the architecture specific pieces. // // This function handles the second part. func asmb2(ctxt *Link) { … } // writePlan9Header writes out the plan9 header at the present position in the OutBuf. func writePlan9Header(buf *OutBuf, magic uint32, entry int64, is64Bit bool) { … } // asmbPlan9 assembles a plan 9 binary. func asmbPlan9(ctxt *Link) { … } // sizeExtRelocs precomputes the size needed for the reloc records, // sets the size and offset for relocation records in each section, // and mmap the output buffer with the proper size. func sizeExtRelocs(ctxt *Link, relsize uint32) { … } // relocSectFn wraps the function writing relocations of a section // for parallel execution. Returns the wrapped function and a wait // group for which the caller should wait. func relocSectFn(ctxt *Link, relocSect func(*Link, *OutBuf, *sym.Section, []loader.Sym)) (func(*Link, *sym.Section, []loader.Sym), *sync.WaitGroup) { … }