]> Cypherpunks repositories - gostls13.git/commit
cmd/link: Add section data slice to Archrelocvariant
authorPaul E. Murphy <murp@ibm.com>
Wed, 10 Mar 2021 21:10:05 +0000 (15:10 -0600)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 18 Mar 2021 19:15:12 +0000 (19:15 +0000)
commite4253cd023e77743ae11d79c4be3dd6db8138aa9
tree1431ba5efddc995e30f217caf5a31dff9991e144
parentb95e4b7850a504748655ad4f025379701afc206c
cmd/link: Add section data slice to Archrelocvariant

PPC64 needs to preserve bits when applying some relocations. DS form
relocations must preserve the lower two bits, and thus needs to inspect
the section data as it streams out.

Similarly, the overflow checking requires inspecting the primary
opcode to see if the value is sign or zero extended.

The existing PPC64 code no longer works as the slice returned by
(loader*).Data is cleared as we layout the symbol and process
relocations.  This data is always the section undergoing relocation,
thus we can directly inspect the contents to preserve bits or
check for overflows.

Change-Id: I239211f7e5e96208673663b6553b3017adae7e01
Reviewed-on: https://go-review.googlesource.com/c/go/+/300555
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
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/data.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/mips/asm.go
src/cmd/link/internal/mips64/asm.go
src/cmd/link/internal/ppc64/asm.go
src/cmd/link/internal/riscv64/asm.go
src/cmd/link/internal/s390x/asm.go
src/cmd/link/internal/x86/asm.go