aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/internal/obj')
-rw-r--r--src/cmd/internal/obj/arm/asm5.go7
-rw-r--r--src/cmd/internal/obj/arm/obj5.go3
-rw-r--r--src/cmd/internal/obj/arm64/obj7.go3
-rw-r--r--src/cmd/internal/obj/sym.go5
-rw-r--r--src/cmd/internal/obj/util.go7
-rw-r--r--src/cmd/internal/obj/x86/asm6.go3
-rw-r--r--src/cmd/internal/obj/x86/obj6.go5
7 files changed, 20 insertions, 13 deletions
diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go
index ebb98b4859..ccf5f9e7f8 100644
--- a/src/cmd/internal/obj/arm/asm5.go
+++ b/src/cmd/internal/obj/arm/asm5.go
@@ -34,6 +34,7 @@ import (
"cmd/internal/obj"
"cmd/internal/objabi"
"fmt"
+ "internal/buildcfg"
"log"
"math"
"sort"
@@ -976,7 +977,7 @@ func (c *ctxt5) aclass(a *obj.Addr) int {
if immrot(^uint32(c.instoffset)) != 0 {
return C_NCON
}
- if uint32(c.instoffset) <= 0xffff && objabi.GOARM == 7 {
+ if uint32(c.instoffset) <= 0xffff && buildcfg.GOARM == 7 {
return C_SCON
}
if x, y := immrot2a(uint32(c.instoffset)); x != 0 && y != 0 {
@@ -3044,7 +3045,7 @@ func (c *ctxt5) omvl(p *obj.Prog, a *obj.Addr, dr int) uint32 {
func (c *ctxt5) chipzero5(e float64) int {
// We use GOARM=7 to gate the use of VFPv3 vmov (imm) instructions.
- if objabi.GOARM < 7 || math.Float64bits(e) != 0 {
+ if buildcfg.GOARM < 7 || math.Float64bits(e) != 0 {
return -1
}
return 0
@@ -3052,7 +3053,7 @@ func (c *ctxt5) chipzero5(e float64) int {
func (c *ctxt5) chipfloat5(e float64) int {
// We use GOARM=7 to gate the use of VFPv3 vmov (imm) instructions.
- if objabi.GOARM < 7 {
+ if buildcfg.GOARM < 7 {
return -1
}
diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go
index edb384806b..1454d8a7c9 100644
--- a/src/cmd/internal/obj/arm/obj5.go
+++ b/src/cmd/internal/obj/arm/obj5.go
@@ -34,6 +34,7 @@ import (
"cmd/internal/obj"
"cmd/internal/objabi"
"cmd/internal/sys"
+ "internal/buildcfg"
"log"
)
@@ -64,7 +65,7 @@ func progedit(ctxt *obj.Link, p *obj.Prog, newprog obj.ProgAlloc) {
ctxt.Diag("%v: TLS MRC instruction must write to R0 as it might get translated into a BL instruction", p.Line())
}
- if objabi.GOARM < 7 {
+ if buildcfg.GOARM < 7 {
// Replace it with BL runtime.read_tls_fallback(SB) for ARM CPUs that lack the tls extension.
if progedit_tlsfallback == nil {
progedit_tlsfallback = ctxt.Lookup("runtime.read_tls_fallback")
diff --git a/src/cmd/internal/obj/arm64/obj7.go b/src/cmd/internal/obj/arm64/obj7.go
index 514991e340..e41fb3bb75 100644
--- a/src/cmd/internal/obj/arm64/obj7.go
+++ b/src/cmd/internal/obj/arm64/obj7.go
@@ -35,6 +35,7 @@ import (
"cmd/internal/objabi"
"cmd/internal/src"
"cmd/internal/sys"
+ "internal/buildcfg"
"log"
"math"
)
@@ -576,7 +577,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
q1.To.Reg = REGSP
q1.Spadj = c.autosize
- if objabi.GOOS == "ios" {
+ if buildcfg.GOOS == "ios" {
// iOS does not support SA_ONSTACK. We will run the signal handler
// on the G stack. If we write below SP, it may be clobbered by
// the signal handler. So we save LR after decrementing SP.
diff --git a/src/cmd/internal/obj/sym.go b/src/cmd/internal/obj/sym.go
index 98c7364e2a..9e8b4dd790 100644
--- a/src/cmd/internal/obj/sym.go
+++ b/src/cmd/internal/obj/sym.go
@@ -35,6 +35,7 @@ import (
"cmd/internal/goobj"
"cmd/internal/objabi"
"fmt"
+ "internal/buildcfg"
"log"
"math"
"sort"
@@ -49,8 +50,8 @@ func Linknew(arch *LinkArch) *Link {
ctxt.Arch = arch
ctxt.Pathname = objabi.WorkingDir()
- if err := ctxt.Headtype.Set(objabi.GOOS); err != nil {
- log.Fatalf("unknown goos %s", objabi.GOOS)
+ if err := ctxt.Headtype.Set(buildcfg.GOOS); err != nil {
+ log.Fatalf("unknown goos %s", buildcfg.GOOS)
}
ctxt.Flag_optimize = true
diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go
index 1c34b4e833..e8441a6969 100644
--- a/src/cmd/internal/obj/util.go
+++ b/src/cmd/internal/obj/util.go
@@ -8,6 +8,7 @@ import (
"bytes"
"cmd/internal/objabi"
"fmt"
+ "internal/buildcfg"
"io"
"strings"
)
@@ -83,7 +84,7 @@ func CConv(s uint8) string {
}
for i := range opSuffixSpace {
sset := &opSuffixSpace[i]
- if sset.arch == objabi.GOARCH {
+ if sset.arch == buildcfg.GOARCH {
return sset.cconv(s)
}
}
@@ -330,7 +331,7 @@ func writeDconv(w io.Writer, p *Prog, a *Addr, abiDetail bool) {
case TYPE_SHIFT:
v := int(a.Offset)
ops := "<<>>->@>"
- switch objabi.GOARCH {
+ switch buildcfg.GOARCH {
case "arm":
op := ops[((v>>5)&3)<<1:]
if v&(1<<4) != 0 {
@@ -346,7 +347,7 @@ func writeDconv(w io.Writer, p *Prog, a *Addr, abiDetail bool) {
r := (v >> 16) & 31
fmt.Fprintf(w, "%s%c%c%d", Rconv(r+RBaseARM64), op[0], op[1], (v>>10)&63)
default:
- panic("TYPE_SHIFT is not supported on " + objabi.GOARCH)
+ panic("TYPE_SHIFT is not supported on " + buildcfg.GOARCH)
}
case TYPE_REGREG:
diff --git a/src/cmd/internal/obj/x86/asm6.go b/src/cmd/internal/obj/x86/asm6.go
index 52ac567a36..17fa76727e 100644
--- a/src/cmd/internal/obj/x86/asm6.go
+++ b/src/cmd/internal/obj/x86/asm6.go
@@ -36,6 +36,7 @@ import (
"cmd/internal/sys"
"encoding/binary"
"fmt"
+ "internal/buildcfg"
"log"
"strings"
)
@@ -2460,7 +2461,7 @@ func instinit(ctxt *obj.Link) {
}
}
-var isAndroid = objabi.GOOS == "android"
+var isAndroid = buildcfg.GOOS == "android"
func prefixof(ctxt *obj.Link, a *obj.Addr) int {
if a.Reg < REG_CS && a.Index < REG_CS { // fast path
diff --git a/src/cmd/internal/obj/x86/obj6.go b/src/cmd/internal/obj/x86/obj6.go
index 06736d43bd..e2732d53e3 100644
--- a/src/cmd/internal/obj/x86/obj6.go
+++ b/src/cmd/internal/obj/x86/obj6.go
@@ -35,6 +35,7 @@ import (
"cmd/internal/objabi"
"cmd/internal/src"
"cmd/internal/sys"
+ "internal/buildcfg"
"log"
"math"
"path"
@@ -646,13 +647,13 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
var regg int16
if !p.From.Sym.NoSplit() || p.From.Sym.Wrapper() {
- if ctxt.Arch.Family == sys.AMD64 && objabi.Experiment.RegabiG && cursym.ABI() == obj.ABIInternal {
+ if ctxt.Arch.Family == sys.AMD64 && buildcfg.Experiment.RegabiG && cursym.ABI() == obj.ABIInternal {
regg = REGG // use the g register directly in ABIInternal
} else {
p = obj.Appendp(p, newprog)
regg = REG_CX
if ctxt.Arch.Family == sys.AMD64 {
- // Using this register means that stacksplit works w/ //go:registerparams even when !objabi.Experiment.RegabiG
+ // Using this register means that stacksplit works w/ //go:registerparams even when !buildcfg.Experiment.RegabiG
regg = REGG // == REG_R14
}
p = load_g(ctxt, p, newprog, regg) // load g into regg