mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd: remove Go115AMD64
Always do aligned jumps now. Change-Id: If68a16fe93c9173c83323a9063465c9bd166eeb8 Reviewed-on: https://go-review.googlesource.com/c/go/+/266857 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
parent
e463c28cc1
commit
fdba080220
5 changed files with 7 additions and 29 deletions
|
|
@ -390,12 +390,7 @@ func TestARM64Errors(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAMD64EndToEnd(t *testing.T) {
|
||||
defer func(old string) { objabi.GOAMD64 = old }(objabi.GOAMD64)
|
||||
for _, goamd64 := range []string{"normaljumps", "alignedjumps"} {
|
||||
t.Logf("GOAMD64=%s", goamd64)
|
||||
objabi.GOAMD64 = goamd64
|
||||
testEndToEnd(t, "amd64", "amd64")
|
||||
}
|
||||
}
|
||||
|
||||
func Test386Encoder(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -1851,9 +1851,9 @@ func spadjop(ctxt *obj.Link, l, q obj.As) obj.As {
|
|||
return q
|
||||
}
|
||||
|
||||
// If the environment variable GOAMD64=alignedjumps the assembler will ensure that
|
||||
// no standalone or macro-fused jump will straddle or end on a 32 byte boundary
|
||||
// by inserting NOPs before the jumps
|
||||
// isJump returns whether p is a jump instruction.
|
||||
// It is used to ensure that no standalone or macro-fused jump will straddle
|
||||
// or end on a 32 byte boundary by inserting NOPs before the jumps.
|
||||
func isJump(p *obj.Prog) bool {
|
||||
return p.To.Target() != nil || p.As == obj.AJMP || p.As == obj.ACALL ||
|
||||
p.As == obj.ARET || p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO
|
||||
|
|
@ -1987,11 +1987,6 @@ func makePjcCtx(ctxt *obj.Link) padJumpsCtx {
|
|||
return padJumpsCtx(0)
|
||||
}
|
||||
|
||||
if objabi.GOAMD64 != "alignedjumps" {
|
||||
return padJumpsCtx(0)
|
||||
|
||||
}
|
||||
|
||||
return padJumpsCtx(32)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ var (
|
|||
GOARCH = envOr("GOARCH", defaultGOARCH)
|
||||
GOOS = envOr("GOOS", defaultGOOS)
|
||||
GO386 = envOr("GO386", defaultGO386)
|
||||
GOAMD64 = goamd64()
|
||||
GOARM = goarm()
|
||||
GOMIPS = gomips()
|
||||
GOMIPS64 = gomips64()
|
||||
|
|
@ -38,14 +37,8 @@ var (
|
|||
const (
|
||||
ElfRelocOffset = 256
|
||||
MachoRelocOffset = 2048 // reserve enough space for ELF relocations
|
||||
Go115AMD64 = "alignedjumps" // Should be "alignedjumps" or "normaljumps"; this replaces environment variable introduced in CL 219357.
|
||||
)
|
||||
|
||||
// TODO(1.16): assuming no issues in 1.15 release, remove this and related constant.
|
||||
func goamd64() string {
|
||||
return Go115AMD64
|
||||
}
|
||||
|
||||
func goarm() int {
|
||||
switch v := envOr("GOARM", defaultGOARM); v {
|
||||
case "5":
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ package amd64
|
|||
const (
|
||||
maxAlign = 32 // max data alignment
|
||||
minAlign = 1 // min data alignment
|
||||
funcAlign = 16
|
||||
funcAlign = 32
|
||||
)
|
||||
|
||||
/* Used by ../internal/ld/dwarf.go */
|
||||
|
|
|
|||
|
|
@ -39,13 +39,8 @@ import (
|
|||
func Init() (*sys.Arch, ld.Arch) {
|
||||
arch := sys.ArchAMD64
|
||||
|
||||
fa := funcAlign
|
||||
if objabi.GOAMD64 == "alignedjumps" {
|
||||
fa = 32
|
||||
}
|
||||
|
||||
theArch := ld.Arch{
|
||||
Funcalign: fa,
|
||||
Funcalign: funcAlign,
|
||||
Maxalign: maxAlign,
|
||||
Minalign: minAlign,
|
||||
Dwarfregsp: dwarfRegSP,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue