aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/link.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2016-06-17 12:28:31 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2016-08-16 20:26:16 +0000
commit0cd8faf74494f400d278b9b0071908951bea6f40 (patch)
tree29aaa5f0f39a30196e8a9fdff75de3d9004939d1 /src/cmd/internal/obj/link.go
parent496174e32e8983f46c6178cab250ea08f4d89dd2 (diff)
downloadgo-0cd8faf74494f400d278b9b0071908951bea6f40.tar.xz
cmd/internal/obj: add opcode space safety check
This CL adds a safety mechanism for changing the number of opcodes available per architecture. A subsequent CL will actually make the change. Change-Id: I6332ed5514f2f153c54d11b7da0cc8a6be1c8066 Reviewed-on: https://go-review.googlesource.com/24222 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/link.go')
-rw-r--r--src/cmd/internal/obj/link.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go
index 3c66eecbf0..edd45d411d 100644
--- a/src/cmd/internal/obj/link.go
+++ b/src/cmd/internal/obj/link.go
@@ -308,7 +308,8 @@ const (
ABaseMIPS64
ABaseS390X
- AMask = 1<<12 - 1 // AND with this to use the opcode as an array index.
+ AllowedOpCodes = 1 << 12 // The number of opcodes available for any given architecture.
+ AMask = AllowedOpCodes - 1 // AND with this to use the opcode as an array index.
)
// An LSym is the sort of symbol that is written to an object file.