mirror of
https://github.com/golang/go
synced 2024-11-19 13:54:56 -07:00
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>
This commit is contained in:
parent
e8fab405cb
commit
fdc04223c5
@ -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")
|
||||
|
@ -617,7 +617,6 @@ type Link struct {
|
||||
Windows int32
|
||||
Goroot string
|
||||
Goroot_final string
|
||||
Enforce_data_order int32
|
||||
Hash map[SymVer]*LSym
|
||||
LineHist LineHist
|
||||
Imports []string
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user