ld: do not load the same object file multiple times.
eliminates spurious multiple initialization errors.
give more information in the multiple init errors that remain.
Fixes #87.
R=r
CC=golang-dev
https://golang.org/cl/194052
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index e29cdb9..ca67973 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -692,6 +692,12 @@
if(s != S) {
p->dlink = s->data;
s->data = p;
+ if(s->file == nil)
+ s->file = pn;
+ else if(s->file != pn) {
+ diag("multiple initialization for %s: in both %s and %s", s->name, s->file, pn);
+ errorexit();
+ }
}
if(edatap == P)
datap = p;