]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.5] cmd/link: support new 386/amd64 relocations
authorIan Lance Taylor <iant@golang.org>
Sat, 31 Oct 2015 21:44:48 +0000 (14:44 -0700)
committerAustin Clements <austin@google.com>
Tue, 17 Nov 2015 02:23:57 +0000 (02:23 +0000)
commitc0c730da28938b4ca920da67c5e143c007c505a7
treeece6db0b9d62cab72f8fc330939b2d5015082785
parent8b3f554d869e1d6e7a0bd1574135402cfc6dc1a3
[release-branch.go1.5] cmd/link: support new 386/amd64 relocations

The GNU binutils recently picked up support for new 386/amd64
relocations.  Add support for them in the Go linker when doing an
internal link.

The 386 relocation R_386_GOT32X was proposed in
https://groups.google.com/forum/#!topic/ia32-abi/GbJJskkid4I .  It can
be treated as identical to the R_386_GOT32 relocation.

The amd64 relocations R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX were
proposed in
https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0 .  They
can both be treated as identical to the R_X86_64_GOTPCREL relocation.

The purpose of the new relocations is to permit additional linker
relaxations in some cases.  We do not attempt to support those cases.

While we're at it, remove the unused and in some cases out of date
_COUNT names from ld/elf.go.

Fixes #13114.

Change-Id: I34ef07f6fcd00cdd2996038ecf46bb77a49e968b
Reviewed-on: https://go-review.googlesource.com/16529
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/16982
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/link/internal/amd64/asm.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/ldelf.go
src/cmd/link/internal/x86/asm.go