1
0
mirror of https://github.com/golang/go synced 2024-11-24 05:30:24 -07:00

cmd/link: bump object file version number

The format has been tweaked several times in the latest cycle, so
replace go13ld with go17ld.

Change-Id: I343c49b02b7516fd781bc96ad46640579da68c59
Reviewed-on: https://go-review.googlesource.com/22708
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
David Crawshaw 2016-05-02 17:32:14 -04:00
parent 097e2c0a8a
commit 6b019e216b
3 changed files with 10 additions and 10 deletions

View File

@ -580,7 +580,7 @@ func (r *objReader) parseObject(prefix []byte) error {
}
r.readFull(r.tmp[:8])
if !bytes.Equal(r.tmp[:8], []byte("\x00\x00go13ld")) {
if !bytes.Equal(r.tmp[:8], []byte("\x00\x00go17ld")) {
return r.error(errCorruptObject)
}
@ -687,7 +687,7 @@ func (r *objReader) parseObject(prefix []byte) error {
}
r.readFull(r.tmp[:7])
if !bytes.Equal(r.tmp[:7], []byte("\xffgo13ld")) {
if !bytes.Equal(r.tmp[:7], []byte("\xffgo17ld")) {
return r.error(errCorruptObject)
}

View File

@ -15,7 +15,7 @@
//
// The file format is:
//
// - magic header: "\x00\x00go13ld"
// - magic header: "\x00\x00go17ld"
// - byte 1 - version number
// - sequence of strings giving dependencies (imported packages)
// - empty string (marks end of sequence)
@ -31,7 +31,7 @@
// - data, the content of the defined symbols
// - sequence of defined symbols
// - byte 0xff (marks end of sequence)
// - magic footer: "\xff\xffgo13ld"
// - magic footer: "\xff\xffgo17ld"
//
// All integers are stored in a zigzag varint format.
// See golang.org/s/go12symtab for a definition.
@ -199,7 +199,7 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) {
w := newObjWriter(ctxt, b)
// Magic header
w.wr.WriteString("\x00\x00go13ld")
w.wr.WriteString("\x00\x00go17ld")
// Version
w.wr.WriteByte(1)
@ -249,7 +249,7 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) {
}
// Magic footer
w.wr.WriteString("\xff\xffgo13ld")
w.wr.WriteString("\xff\xffgo17ld")
}
// Symbols are prefixed so their content doesn't get confused with the magic footer.

View File

@ -17,7 +17,7 @@ package ld
//
// The file format is:
//
// - magic header: "\x00\x00go13ld"
// - magic header: "\x00\x00go17ld"
// - byte 1 - version number
// - sequence of strings giving dependencies (imported packages)
// - empty string (marks end of sequence)
@ -33,7 +33,7 @@ package ld
// - data, the content of the defined symbols
// - sequence of defined symbols
// - byte 0xff (marks end of sequence)
// - magic footer: "\xff\xffgo13ld"
// - magic footer: "\xff\xffgo17ld"
//
// All integers are stored in a zigzag varint format.
// See golang.org/s/go12symtab for a definition.
@ -121,8 +121,8 @@ import (
)
const (
startmagic = "\x00\x00go13ld"
endmagic = "\xff\xffgo13ld"
startmagic = "\x00\x00go17ld"
endmagic = "\xff\xffgo17ld"
)
var emptyPkg = []byte(`"".`)