]> Cypherpunks repositories - gostls13.git/commit
cmd/link: always resolve functions locally when linking dynamically
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 28 Oct 2015 23:17:43 +0000 (12:17 +1300)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Thu, 29 Oct 2015 19:19:07 +0000 (19:19 +0000)
commitc34fb3cfc69c81c9671c097b599e9e642a9d1fed
tree7ca940b4621c5a559bc7f65a8bb3b07e21e3be3b
parentab7e82ef3b773468f008df439568e792eb24d5fd
cmd/link: always resolve functions locally when linking dynamically

When dynamically linking, we want references to functions defined
in this module to always be to the function object, not to the
PLT. We force this by writing an additional local symbol for
every global function symbol and making all relocations against
the global symbol refer to this local symbol instead. This is
approximately equivalent to the ELF linker -Bsymbolic-functions
option, but that is buggy on several platforms.

Change-Id: Ie6983eb4d1947f8543736fd349f9a90df3cce91a
Reviewed-on: https://go-review.googlesource.com/16436
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/amd64/asm.go
src/cmd/link/internal/arm/asm.go
src/cmd/link/internal/arm64/asm.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/link.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/x86/asm.go