00001080 02 20 00 04 20 00 06 05 02 05 02 05 02 05 02 02 |. .. ...........|
00001090 02 02 02 05 02 02 02 01 00 00 00 00 00 00 00 00 |................|
000010a0 02 00 00 00 88 00 00 00 2f 55 73 65 72 73 2f 72 |......../Users/r|
-000010b0 73 63 2f 72 73 63 67 6f 2f 73 72 63 2f 63 6d 64 |sc/rscgo/src/cmd|
-000010c0 2f 6c 64 32 2f 74 65 73 74 64 61 74 61 2f 68 65 |/ld2/testdata/he|
+000010b0 73 63 2f 67 2f 67 6f 2f 73 72 63 2f 63 6d 64 2f |sc/g/go/src/cmd/|
+000010c0 6c 69 6e 6b 2f 74 65 73 74 64 61 74 61 2f 68 65 |link/testdata/he|
000010d0 6c 6c 6f 2e 73 00 00 00 00 00 00 00 00 00 00 00 |llo.s...........|
*
00002000 68 65 6c 6c 6f 20 77 6f 72 6c 64 0a |hello world.|
// The file format is:
//
// - magic header: "\x00\x00go13ld"
+// - byte 1 - version number
// - sequence of strings giving dependencies (imported packages)
// - empty string (marks end of sequence)
// - sequence of defined symbols
Bputc(b, 0);
Bputc(b, 0);
Bprint(b, "go13ld");
-
+ Bputc(b, 1); // version
+
// Emit autolib.
for(h = ctxt->hist; h != nil; h = h->link)
if(h->offset < 0)
Bread(f, buf, sizeof buf);
if(memcmp(buf, startmagic, sizeof buf) != 0)
sysfatal("%s: invalid file start %x %x %x %x %x %x %x %x", pn, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
+ if((c = Bgetc(f)) != 1)
+ sysfatal("%s: invalid file version number %d", pn, c);
for(;;) {
lib = rdstring(f);