mirror of
https://github.com/golang/go
synced 2024-11-24 12:30:14 -07:00
ld: fail linking if the top-level package is not main.
This makes {5,6,8}l conform to the spec more tightly. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4826063
This commit is contained in:
parent
3dbe10c453
commit
11e254e62c
@ -148,8 +148,11 @@ ldpkg(Biobuf *f, char *pkg, int64 len, char *filename, int whence)
|
||||
;
|
||||
}
|
||||
}
|
||||
if(strcmp(pkg, "main") == 0 && strcmp(name, "main") != 0)
|
||||
if(strcmp(pkg, "main") == 0 && strcmp(name, "main") != 0) {
|
||||
fprint(2, "%s: %s: not package main (package %s)\n", argv0, filename, name);
|
||||
nerrors++;
|
||||
errorexit();
|
||||
}
|
||||
loadpkgdata(filename, pkg, p0, p1 - p0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user