cmd/link/internal/ld: move ld.Cpos to coutbuf.Offset

This change moves the ld.Cpos function to a method on coutbuf. This is
part of a larger change that makes ld.outbuf look more like a bio.Buf in
an effort to eventually replace the former with the latter.

Change-Id: I506f7131935a2aa903fa302a0fab0c5be50220fd
Reviewed-on: https://go-review.googlesource.com/27578
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Dave Cheney 2016-08-24 20:27:38 +10:00
parent 61d5daea0a
commit 5f94ff4c87
5 changed files with 34 additions and 35 deletions

View file

@ -229,6 +229,10 @@ func (w *outBuf) WriteString(s string) (n int, err error) {
return n, err
}
func (w *outBuf) Offset() int64 {
return w.off
}
var coutbuf outBuf
const pkgname = "__.PKGDEF"
@ -1771,10 +1775,6 @@ func Cflush() {
}
}
func Cpos() int64 {
return coutbuf.off
}
func Cseek(p int64) {
if p == coutbuf.off {
return