1
0
mirror of https://github.com/golang/go synced 2024-11-20 08:14:41 -07:00
go/src/libmach
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
..
5.c support for 5.out files 2009-10-19 22:33:56 -07:00
5db.c support for 5.out files 2009-10-19 22:33:56 -07:00
5obj.c libmach: correct handling of .5 files with D_REGREG addresses 2010-07-22 09:00:34 -07:00
6.c rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
6obj.c rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
8.c rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
8db.c libmach: fix build on arm host 2010-09-15 16:52:11 -04:00
8obj.c fix build after Mercurial move. 2009-10-22 10:59:27 -07:00
access.c rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
darwin.c libmach: detail for darwin errors 2010-11-05 23:03:53 -04:00
elf.h rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
executable.c 5l, 6l, 8l: link pclntab and symtab as ordinary rodata symbols 2010-10-19 18:07:19 -04:00
fakeobj.c rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
freebsd.c FreeBSD-specific porting work. 2009-11-17 08:20:58 -08:00
linux.c libmach: fix whitespace. 2010-09-12 16:40:31 +10:00
machdata.c rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
macho.h rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
Makefile build: $GOBIN defaults to $GOROOT/bin 2010-08-24 20:00:33 -04:00
map.c rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
obj.c gc, ld: detect stale or incompatible object files 2011-02-03 13:51:43 -05:00
obj.h rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
setmach.c support for 5.out files 2009-10-19 22:33:56 -07:00
swap.c rename libmach_amd64 libmach 2009-08-14 10:46:04 -07:00
sym.c fix bug introduced in 33293 2009-09-02 11:12:42 -07:00
windows.c cov and prof: implement windows version (just function stubs and build mods) 2010-07-30 11:47:11 +10:00