1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:18:32 -06:00
go/misc/cgo
Michael Hudson-Doyle 77fc03f4cd cmd/internal/ld, runtime: abort on shared library ABI mismatch
This:

1) Defines the ABI hash of a package (as the SHA1 of the __.PKGDEF)
2) Defines the ABI hash of a shared library (sort the packages by import
   path, concatenate the hashes of the packages and SHA1 that)
3) When building a shared library, compute the above value and define a
   global symbol that points to a go string that has the hash as its value.
4) When linking against a shared library, read the abi hash from the
   library and put both the value seen at link time and a reference
   to the global symbol into the moduledata.
5) During runtime initialization, check that the hash seen at link time
   still matches the hash the global symbol points to.

Change-Id: Iaa54c783790e6dde3057a2feadc35473d49614a5
Reviewed-on: https://go-review.googlesource.com/8773
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
2015-05-12 01:30:40 +00:00
..
errors build: convert run.bash, run.bat, and run.rc into a Go program 2015-03-03 23:22:11 +00:00
gmp misc/cgo/gmp: fix typo. 2013-03-30 19:02:14 +08:00
life misc/cgo: prepare for 64-bit ints 2012-09-24 14:58:45 -04:00
nocgo cmd/ld: really import runtime/cgo for external link 2014-05-20 21:36:50 -07:00
stdio misc/cgo/stdio: make it work on Windows and also test it 2012-09-20 00:27:23 +08:00
test misc/cgo: add various solaris build lines 2015-05-06 11:38:08 +00:00
testasan runtime: more flexible heap memory mapping on 64-bits 2013-06-12 18:47:16 +04:00
testcarchive cmd/go: install headers for c-archive/c-shared cgo exports 2015-05-07 17:39:56 +00:00
testcshared cmd/go: install headers for c-archive/c-shared cgo exports 2015-05-07 17:39:56 +00:00
testgodefs build: convert run.bash, run.bat, and run.rc into a Go program 2015-03-03 23:22:11 +00:00
testshared cmd/internal/ld, runtime: abort on shared library ABI mismatch 2015-05-12 01:30:40 +00:00
testsigfwd runtime: signal forwarding 2015-04-24 05:19:39 +00:00
testso misc/cgo: add various solaris build lines 2015-05-06 11:38:08 +00:00
testtls misc/cgo/testtls: make test less flaky 2014-01-21 19:44:51 -05:00