aboutsummaryrefslogtreecommitdiff
path: root/misc/cgo/testshared/test.bash
AgeCommit message (Collapse)Author
2015-05-18misc/cgo/testshared: rewrite in GoMichael Hudson-Doyle
And fix to work on filesystems with only 1s resolution. Fixes #10724 Change-Id: Ia07463f090b4290fc27f5953fa94186463d7afc7 Reviewed-on: https://go-review.googlesource.com/9768 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-05-12cmd/internal/ld, runtime: abort on shared library ABI mismatchMichael Hudson-Doyle
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-12runtime: fix addmoduledata to follow the platform ABIMichael Hudson-Doyle
addmoduledata is called from a .init_array function and need to follow the platform ABI. It contains accesses to global data which are rewritten to use R15 by the assembler, and as R15 is callee-save we need to save it. Change-Id: I03893efb1576aed4f102f2465421f256f3bb0f30 Reviewed-on: https://go-review.googlesource.com/9941 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-05-05cmd/go: rebuild stale shared objects before linking against them.Michael Hudson-Doyle
This changes the action graph when shared libraries are involved to always have an action for the shared library (which does nothing when the shared library is up to date). Change-Id: Ibbc70fd01cbb3f4e8c0ef96e62a151002d446144 Reviewed-on: https://go-review.googlesource.com/8934 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-04-29misc/cgo/testshared: add basic test for -buildmode=shared/-linksharedMichael Hudson-Doyle
Just a first basic test, I'll extend this to test more but want to get an opinion on basic approach first. Change-Id: Idab9ebd7d9960b000b81a01a1e53258bf4bce755 Reviewed-on: https://go-review.googlesource.com/9386 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>