From 6b019e216b4521c2375572a4edf2e08c1d9bc754 Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Mon, 2 May 2016 17:32:14 -0400 Subject: [PATCH] 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/internal/goobj/read.go | 4 ++-- src/cmd/internal/obj/objfile.go | 8 ++++---- src/cmd/link/internal/ld/objfile.go | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cmd/internal/goobj/read.go b/src/cmd/internal/goobj/read.go index 698d58efe00..69fa496110d 100644 --- a/src/cmd/internal/goobj/read.go +++ b/src/cmd/internal/goobj/read.go @@ -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) } diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index 17175ebf06b..a1fdee60701 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -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. diff --git a/src/cmd/link/internal/ld/objfile.go b/src/cmd/link/internal/ld/objfile.go index bcfe52585ff..d16431ddaa2 100644 --- a/src/cmd/link/internal/ld/objfile.go +++ b/src/cmd/link/internal/ld/objfile.go @@ -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(`"".`)