1
0
mirror of https://github.com/golang/go synced 2024-10-04 01:21:21 -06:00
go/src/cmd/8c
Russ Cox 3f61184e1b gc, ld: detect stale or incompatible object files
The object files begin with a header that is

        $GOARCH

on a line by itself.  This CL changes that header to

        go object $GOOS $GOARCH release.2011-01-01 4567+

where the final two fields are the most recent release
tag and the current hg version number.

All objects imported into a Go compilation or linked into an
executable must have the same header line, and that header
line must match the compiler and linker versions.

The effect of this will be that if you update and run all.bash
and then try to link in objects compiled with an earlier version
of the compiler (or invoke the wrong version of the compiler),
you will get an error showing the different headers instead
of perhaps silent incompatibility.

Normal usage with all.bash should be unaffected, because
all.bash deletes all the object files in $GOROOT/pkg/$GOOS_$GOARCH
and cleans all intermediate object files before starting.

This change is intended to diagnose stale objects arising when
users maintaining alternate installation directories forget to
rebuild some of their files after updating.

It should help make the adoption of $GOPATH (CL 3780043)
less error-prone.

R=ken2, r
CC=golang-dev
https://golang.org/cl/4023063
2011-02-03 13:51:43 -05:00
..
cgen64.c gc: align structs according to max alignment of fields 2010-12-13 16:22:19 -05:00
cgen.c 8c: only refer to extern register variables in MOVL instructions 2010-01-06 18:18:07 -08:00
div.c various: avoid %ld etc 2010-10-13 16:20:22 -04:00
doc.go tweak documentation of commands 2009-11-09 11:45:15 -08:00
gc.h move 6c/pgen.c, 6c/pswt.c into cc 2009-07-07 10:07:15 -07:00
list.c 6c, 8c: show line numbers in -S output 2010-09-10 11:53:51 -04:00
machcap.c 8a, 8c, and 8l from inferno distribution 2009-01-06 09:41:38 -08:00
Makefile build: $GOBIN defaults to $GOROOT/bin 2010-08-24 20:00:33 -04:00
mul.c various: avoid %ld etc 2010-10-13 16:20:22 -04:00
peep.c compilers were inconsistent about 2009-07-13 19:20:43 -07:00
reg.c various: avoid %ld etc 2010-10-13 16:20:22 -04:00
sgen.c cc: disallow ... argument unless NOSPLIT is set. 2010-03-04 15:34:25 -08:00
swt.c gc, ld: detect stale or incompatible object files 2011-02-03 13:51:43 -05:00
txt.c gc: align structs according to max alignment of fields 2010-12-13 16:22:19 -05:00