]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.cc] cmd/objwriter: add placeholder program
authorRuss Cox <rsc@golang.org>
Mon, 19 Jan 2015 16:45:48 +0000 (11:45 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 21 Jan 2015 00:44:56 +0000 (00:44 +0000)
cmd/internal/obj is the name for the Go translation of the C liblink library.

cmd/objwriter is the name of a Go binary that runs liblink's writeobj function.
When the bulk of liblink has been converted to Go but the assemblers and
compilers are still written in C, the C writeobj will shell out to the Go objwriter
to actually write the object file. This lets us manage the transition in smaller
pieces.

The objwriter tool is purely transitional.
It will not ship in any release (enforced in cmd/dist).

Adding a dummy program and some dummy imports here so that we
can work on the bootstrap mechanisms that will be necessary to build it.
Once the build process handles objwriter properly,
we'll work on the actual implementation.

Change-Id: I675c818b3a513c26bb91c6dba564c6ace3b7fcd4
Reviewed-on: https://go-review.googlesource.com/3043
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/dist/build.go
src/cmd/go/pkg.go
src/cmd/internal/obj/dummy.go [new file with mode: 0644]
src/cmd/internal/obj/x86/dummy.go [new file with mode: 0644]
src/cmd/objwriter/main.go [new file with mode: 0644]

index 366612cdd1ee439b365b0141105862ed39089a90..eddc246cf2b3c5945327dfde42a556e5b7536b13 100644 (file)
@@ -356,6 +356,7 @@ var oldtool = []string{
 // not be in release branches.
 var unreleased = []string{
        "src/cmd/link",
+       "src/cmd/objwriter",
        "src/debug/goobj",
        "src/old",
 }
index 23154f91207699882ba98179f7a58dddcf0a28b1..ccecf6a867a7197cc85f7569aea4e0fb82b1602a 100644 (file)
@@ -398,6 +398,7 @@ var goTools = map[string]targetDir{
        "cmd/link":                             toTool,
        "cmd/nm":                               toTool,
        "cmd/objdump":                          toTool,
+       "cmd/objwriter":                        toTool,
        "cmd/pack":                             toTool,
        "cmd/pprof":                            toTool,
        "cmd/yacc":                             toTool,
diff --git a/src/cmd/internal/obj/dummy.go b/src/cmd/internal/obj/dummy.go
new file mode 100644 (file)
index 0000000..9f7df3a
--- /dev/null
@@ -0,0 +1,9 @@
+// Copyright 2015 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Dummy placeholder for the real obj package.
+
+package obj
+
+var Exported bool
diff --git a/src/cmd/internal/obj/x86/dummy.go b/src/cmd/internal/obj/x86/dummy.go
new file mode 100644 (file)
index 0000000..e790ef9
--- /dev/null
@@ -0,0 +1,9 @@
+// Copyright 2015 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Dummy placeholder for the real obj package.
+
+package x86
+
+var Exported bool
diff --git a/src/cmd/objwriter/main.go b/src/cmd/objwriter/main.go
new file mode 100644 (file)
index 0000000..25a9def
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2015 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Objwriter reads an object file description in an unspecified format
+// and writes a Go object file. It is invoked by parts of the toolchain
+// that have not yet been converted from C to Go and should not be
+// used otherwise.
+package main
+
+import "cmd/internal/obj"
+import (
+       "cmd/internal/obj/x86"
+)
+
+// TODO(rsc): Implement.
+// For now we just check that the objwriter binary is available to be run.
+
+func main() {
+       _ = obj.Exported
+       _ = x86.Exported
+}