aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/objfile.go
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2022-05-05 17:45:27 -0400
committerCherry Mui <cherryyz@google.com>2022-05-11 22:59:46 +0000
commit6e03de7b83426fa2f598c428a19db707a845bf7e (patch)
tree06003a502e04aab9bb03b990b02cc7e95640be45 /src/cmd/internal/obj/objfile.go
parentb89a1948893d2c6c04497030eb78addd6fd7daf3 (diff)
downloadgo-6e03de7b83426fa2f598c428a19db707a845bf7e.tar.xz
cmd/asm: require -p flag
CL 391014 requires the compiler to be invoked with the -p flag, to specify the package path. Later, CL 394217 makes the compiler to produce an unlinkable object file, so "go tool compile x.go" can still be used on the command line. This CL does the same for the assembler, requiring -p, otherwise generating an unlinkable object. No special case for the main package, as the main package cannot be only assembly code, and there is no way to tell if it is the main package from an assembly file. Now we guarantee that we always have an expanded package path in the object file. A later CL will delete the name expansion code in the linker. Change-Id: I8c10661aaea2ff794614924ead958d80e7e2487d Reviewed-on: https://go-review.googlesource.com/c/go/+/404298 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/internal/obj/objfile.go')
-rw-r--r--src/cmd/internal/obj/objfile.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go
index d31afda703..89339b0147 100644
--- a/src/cmd/internal/obj/objfile.go
+++ b/src/cmd/internal/obj/objfile.go
@@ -51,7 +51,7 @@ func WriteObjFile(ctxt *Link, b *bio.Writer) {
flags |= goobj.ObjFlagUnlinkable
}
if w.pkgpath == "" {
- flags |= goobj.ObjFlagNeedNameExpansion
+ log.Fatal("empty package path")
}
if ctxt.IsAsm {
flags |= goobj.ObjFlagFromAssembly