diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2016-03-16 14:10:51 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2016-03-16 23:25:33 +0000 |
| commit | fb950cd7786d28a239c64f0799913eeea10acbc2 (patch) | |
| tree | 1f6a8644c0f68fddca9525bc892d7ef8b6a87eba /src/cmd/internal/obj/data.go | |
| parent | 5a34472d74637c84752d2c13ace78e4e6ab756b7 (diff) | |
| download | go-fb950cd7786d28a239c64f0799913eeea10acbc2.tar.xz | |
cmd/internal/obj: convert Symgrow to a method
Passes toolstash -cmp.
Change-Id: I77a415a4e5d8de7eb902fb0866aaf8783259485a
Reviewed-on: https://go-review.googlesource.com/20770
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/data.go')
| -rw-r--r-- | src/cmd/internal/obj/data.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cmd/internal/obj/data.go b/src/cmd/internal/obj/data.go index ade79faac7..0bb8aa2a7e 100644 --- a/src/cmd/internal/obj/data.go +++ b/src/cmd/internal/obj/data.go @@ -36,10 +36,11 @@ import ( "math" ) -func Symgrow(ctxt *Link, s *LSym, lsiz int64) { +// Grow increases the length of s.P to lsiz. +func (s *LSym) Grow(lsiz int64) { siz := int(lsiz) if int64(siz) != lsiz { - log.Fatalf("Symgrow size %d too long", lsiz) + log.Fatalf("LSym.Grow size %d too long", lsiz) } if len(s.P) >= siz { return @@ -60,7 +61,7 @@ func (s *LSym) prepwrite(ctxt *Link, off int64, siz int) { if s.Type == SBSS || s.Type == STLSBSS { ctxt.Diag("cannot supply data for BSS var") } - Symgrow(ctxt, s, off+int64(siz)) + s.Grow(off + int64(siz)) } // WriteFloat32 writes f into s at offset off. @@ -127,7 +128,7 @@ func Setuintxx(ctxt *Link, s *LSym, off int64, v uint64, wid int64) int64 { } if s.Size < off+wid { s.Size = off + wid - Symgrow(ctxt, s, s.Size) + s.Grow(s.Size) } switch wid { |
