Commit 6b019e21 authored by David Crawshaw's avatar David Crawshaw

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/22708Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 097e2c0a
...@@ -580,7 +580,7 @@ func (r *objReader) parseObject(prefix []byte) error { ...@@ -580,7 +580,7 @@ func (r *objReader) parseObject(prefix []byte) error {
} }
r.readFull(r.tmp[:8]) 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) return r.error(errCorruptObject)
} }
...@@ -687,7 +687,7 @@ func (r *objReader) parseObject(prefix []byte) error { ...@@ -687,7 +687,7 @@ func (r *objReader) parseObject(prefix []byte) error {
} }
r.readFull(r.tmp[:7]) 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) return r.error(errCorruptObject)
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// //
// The file format is: // The file format is:
// //
// - magic header: "\x00\x00go13ld" // - magic header: "\x00\x00go17ld"
// - byte 1 - version number // - byte 1 - version number
// - sequence of strings giving dependencies (imported packages) // - sequence of strings giving dependencies (imported packages)
// - empty string (marks end of sequence) // - empty string (marks end of sequence)
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
// - data, the content of the defined symbols // - data, the content of the defined symbols
// - sequence of defined symbols // - sequence of defined symbols
// - byte 0xff (marks end of sequence) // - byte 0xff (marks end of sequence)
// - magic footer: "\xff\xffgo13ld" // - magic footer: "\xff\xffgo17ld"
// //
// All integers are stored in a zigzag varint format. // All integers are stored in a zigzag varint format.
// See golang.org/s/go12symtab for a definition. // See golang.org/s/go12symtab for a definition.
...@@ -199,7 +199,7 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) { ...@@ -199,7 +199,7 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) {
w := newObjWriter(ctxt, b) w := newObjWriter(ctxt, b)
// Magic header // Magic header
w.wr.WriteString("\x00\x00go13ld") w.wr.WriteString("\x00\x00go17ld")
// Version // Version
w.wr.WriteByte(1) w.wr.WriteByte(1)
...@@ -249,7 +249,7 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) { ...@@ -249,7 +249,7 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) {
} }
// Magic footer // 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. // Symbols are prefixed so their content doesn't get confused with the magic footer.
......
...@@ -17,7 +17,7 @@ package ld ...@@ -17,7 +17,7 @@ package ld
// //
// The file format is: // The file format is:
// //
// - magic header: "\x00\x00go13ld" // - magic header: "\x00\x00go17ld"
// - byte 1 - version number // - byte 1 - version number
// - sequence of strings giving dependencies (imported packages) // - sequence of strings giving dependencies (imported packages)
// - empty string (marks end of sequence) // - empty string (marks end of sequence)
...@@ -33,7 +33,7 @@ package ld ...@@ -33,7 +33,7 @@ package ld
// - data, the content of the defined symbols // - data, the content of the defined symbols
// - sequence of defined symbols // - sequence of defined symbols
// - byte 0xff (marks end of sequence) // - byte 0xff (marks end of sequence)
// - magic footer: "\xff\xffgo13ld" // - magic footer: "\xff\xffgo17ld"
// //
// All integers are stored in a zigzag varint format. // All integers are stored in a zigzag varint format.
// See golang.org/s/go12symtab for a definition. // See golang.org/s/go12symtab for a definition.
...@@ -121,8 +121,8 @@ import ( ...@@ -121,8 +121,8 @@ import (
) )
const ( const (
startmagic = "\x00\x00go13ld" startmagic = "\x00\x00go17ld"
endmagic = "\xff\xffgo13ld" endmagic = "\xff\xffgo17ld"
) )
var emptyPkg = []byte(`"".`) var emptyPkg = []byte(`"".`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment