aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/objabi
diff options
context:
space:
mode:
authorRichard Musiol <mail@richard-musiol.de>2018-03-29 00:55:53 +0200
committerBrad Fitzpatrick <bradfitz@golang.org>2018-05-04 17:56:12 +0000
commit3b137dd2df19c261a007b8a620a2182cd679d700 (patch)
tree1008f11b278e1fc1dc6dc222c0c67654a6fee534 /src/cmd/internal/objabi
parenta9fc37525891e47b4277cde040a06db585e1780d (diff)
downloadgo-3b137dd2df19c261a007b8a620a2182cd679d700.tar.xz
cmd/compile: add wasm architecture
This commit adds the wasm architecture to the compile command. A later commit will contain the corresponding linker changes. Design doc: https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4 The following files are generated: - src/cmd/compile/internal/ssa/opGen.go - src/cmd/compile/internal/ssa/rewriteWasm.go - src/cmd/internal/obj/wasm/anames.go Updates #18892 Change-Id: Ifb4a96a3e427aac2362a1c97967d5667450fba3b Reviewed-on: https://go-review.googlesource.com/103295 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/internal/objabi')
-rw-r--r--src/cmd/internal/objabi/head.go5
-rw-r--r--src/cmd/internal/objabi/reloctype.go3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/internal/objabi/head.go b/src/cmd/internal/objabi/head.go
index ff19606cd2..23c7b62daf 100644
--- a/src/cmd/internal/objabi/head.go
+++ b/src/cmd/internal/objabi/head.go
@@ -40,6 +40,7 @@ const (
Hdarwin
Hdragonfly
Hfreebsd
+ Hjs
Hlinux
Hnacl
Hnetbsd
@@ -57,6 +58,8 @@ func (h *HeadType) Set(s string) error {
*h = Hdragonfly
case "freebsd":
*h = Hfreebsd
+ case "js":
+ *h = Hjs
case "linux", "android":
*h = Hlinux
case "nacl":
@@ -85,6 +88,8 @@ func (h *HeadType) String() string {
return "dragonfly"
case Hfreebsd:
return "freebsd"
+ case Hjs:
+ return "js"
case Hlinux:
return "linux"
case Hnacl:
diff --git a/src/cmd/internal/objabi/reloctype.go b/src/cmd/internal/objabi/reloctype.go
index ac96b3a71b..a3e2868a1b 100644
--- a/src/cmd/internal/objabi/reloctype.go
+++ b/src/cmd/internal/objabi/reloctype.go
@@ -193,6 +193,9 @@ const (
// R_ADDRCUOFF resolves to a pointer-sized offset from the start of the
// symbol's DWARF compile unit.
R_ADDRCUOFF
+
+ // R_WASMIMPORT resolves to the index of the WebAssembly function import.
+ R_WASMIMPORT
)
// IsDirectJump returns whether r is a relocation for a direct jump.