aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2016-03-13 11:54:14 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2016-03-13 21:11:27 +0000
commitfdc04223c5ed16ba568f6ce1b4859bc06e43df5e (patch)
tree8b73f81ca02d6f5e5c46e3610f0c25e19512d07a /src/cmd/internal/obj
parente8fab405cb5f7e6f10357ed26720c6b8938a5be3 (diff)
downloadgo-fdc04223c5ed16ba568f6ce1b4859bc06e43df5e.tar.xz
cmd/compile: clean up savedata
Simplify function signature. Remove unused Ctxt field Enforce_data_order. Passes toolstash -cmp. Change-Id: I5caa270ca9ae725708fe415b2c978b5f40780255 Reviewed-on: https://go-review.googlesource.com/20644 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/internal/obj')
-rw-r--r--src/cmd/internal/obj/data.go8
-rw-r--r--src/cmd/internal/obj/link.go97
-rw-r--r--src/cmd/internal/obj/objfile.go2
3 files changed, 52 insertions, 55 deletions
diff --git a/src/cmd/internal/obj/data.go b/src/cmd/internal/obj/data.go
index 438435fd58..f4562d9938 100644
--- a/src/cmd/internal/obj/data.go
+++ b/src/cmd/internal/obj/data.go
@@ -52,14 +52,12 @@ func Symgrow(ctxt *Link, s *LSym, lsiz int64) {
s.P = s.P[:siz]
}
-func savedata(ctxt *Link, s *LSym, p *Prog, file string) {
+func savedata(ctxt *Link, p *Prog) {
+ s := p.From.Sym
off := int32(p.From.Offset)
siz := int32(p.From3.Offset)
if off < 0 || siz < 0 || off >= 1<<30 || siz >= 100 {
- log.Fatalf("%s: mangled input file", file)
- }
- if ctxt.Enforce_data_order != 0 && off < int32(len(s.P)) {
- ctxt.Diag("data out of order (already have %d)\n%v", len(s.P), p)
+ log.Fatalf("savedata: bad off=%d siz=%d", off, siz)
}
if s.Type == SBSS || s.Type == STLSBSS {
ctxt.Diag("cannot supply data for BSS var")
diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go
index db66be6bff..91837145ef 100644
--- a/src/cmd/internal/obj/link.go
+++ b/src/cmd/internal/obj/link.go
@@ -602,55 +602,54 @@ const (
// Link holds the context for writing object code from a compiler
// to be linker input or for reading that input into the linker.
type Link struct {
- Goarm int32
- Headtype int
- Arch *LinkArch
- Debugasm int32
- Debugvlog int32
- Debugdivmod int32
- Debugpcln int32
- Flag_shared int32
- Flag_dynlink bool
- Flag_optimize bool
- Bso *Biobuf
- Pathname string
- Windows int32
- Goroot string
- Goroot_final string
- Enforce_data_order int32
- Hash map[SymVer]*LSym
- LineHist LineHist
- Imports []string
- Plist *Plist
- Plast *Plist
- Sym_div *LSym
- Sym_divu *LSym
- Sym_mod *LSym
- Sym_modu *LSym
- Plan9privates *LSym
- Curp *Prog
- Printp *Prog
- Blitrl *Prog
- Elitrl *Prog
- Rexflag int
- Vexflag int
- Rep int
- Repn int
- Lock int
- Asmode int
- Andptr []byte
- And [100]uint8
- Instoffset int64
- Autosize int32
- Armsize int32
- Pc int64
- DiagFunc func(string, ...interface{})
- Mode int
- Cursym *LSym
- Version int
- Textp *LSym
- Etextp *LSym
- Errors int
+ Goarm int32
+ Headtype int
+ Arch *LinkArch
+ Debugasm int32
+ Debugvlog int32
+ Debugdivmod int32
+ Debugpcln int32
+ Flag_shared int32
+ Flag_dynlink bool
+ Flag_optimize bool
+ Bso *Biobuf
+ Pathname string
+ Windows int32
+ Goroot string
+ Goroot_final string
+ Hash map[SymVer]*LSym
+ LineHist LineHist
+ Imports []string
+ Plist *Plist
+ Plast *Plist
+ Sym_div *LSym
+ Sym_divu *LSym
+ Sym_mod *LSym
+ Sym_modu *LSym
+ Plan9privates *LSym
+ Curp *Prog
+ Printp *Prog
+ Blitrl *Prog
+ Elitrl *Prog
+ Rexflag int
+ Vexflag int
+ Rep int
+ Repn int
+ Lock int
+ Asmode int
+ Andptr []byte
+ And [100]uint8
+ Instoffset int64
+ Autosize int32
+ Armsize int32
+ Pc int64
+ DiagFunc func(string, ...interface{})
+ Mode int
+ Cursym *LSym
+ Version int
+ Textp *LSym
+ Etextp *LSym
+ Errors int
// state for writing objects
Text *LSym
diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go
index 9b00c9af2a..0920edafff 100644
--- a/src/cmd/internal/obj/objfile.go
+++ b/src/cmd/internal/obj/objfile.go
@@ -201,7 +201,7 @@ func flushplist(ctxt *Link, freeProgs bool) {
continue
case ADATA:
- savedata(ctxt, p.From.Sym, p, "<input>")
+ savedata(ctxt, p)
continue
case ATEXT: