The name linkwriteobj is misleading because it implies that
the function has something to do with the linker, which it
does not. The name is historical: the function performs an
operation that was previously performed by the linker, but no
longer is.
LGTM=rsc
R=rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/
88210045
// objfile.c
void ldobjfile(Link *ctxt, Biobuf *b, char *pkg, int64 len, char *path);
-void linkwriteobj(Link *ctxt, Biobuf *b);
+void writeobj(Link *ctxt, Biobuf *b);
// pass.c
Prog* brchain(Link *ctxt, Prog *p);
return nerrors;
}
- linkwriteobj(ctxt, &obuf);
+ writeobj(ctxt, &obuf);
Bflush(&obuf);
return 0;
}
}
Bprint(&outbuf, "!\n");
- linkwriteobj(ctxt, &outbuf);
+ writeobj(ctxt, &outbuf);
lastp = P;
}
return nerrors;
}
- linkwriteobj(ctxt, &obuf);
+ writeobj(ctxt, &obuf);
Bflush(&obuf);
return 0;
}
}
Bprint(&b, "!\n");
- linkwriteobj(ctxt, &b);
+ writeobj(ctxt, &b);
Bterm(&b);
close(f);
lastp = P;
return nerrors;
}
- linkwriteobj(ctxt, &obuf);
+ writeobj(ctxt, &obuf);
Bflush(&obuf);
return 0;
}
}
Bprint(&b, "!\n");
- linkwriteobj(ctxt, &b);
+ writeobj(ctxt, &b);
Bterm(&b);
close(f);
lastp = P;
ggloblsym(zero, zerosize, 1, 1);
dumpdata();
- linkwriteobj(ctxt, bout);
+ writeobj(ctxt, bout);
if(writearchive) {
Bflush(bout);
static void rddata(Biobuf*, uchar**, int*);
static LSym *rdsym(Link*, Biobuf*, char*);
+// The Go and C compilers, and the assembler, call writeobj to write
+// out a Go object file. The linker does not call this; the linker
+// does not write out object files.
void
-linkwriteobj(Link *ctxt, Biobuf *b)
+writeobj(Link *ctxt, Biobuf *b)
{
int flag;
Hist *h;