]> Cypherpunks repositories - gostls13.git/commit
cmd/link/internal/ppc64: link ELFv2 objects built with -mcpu=power10
authorPaul E. Murphy <murp@ibm.com>
Mon, 1 May 2023 15:06:22 +0000 (10:06 -0500)
committerPaul Murphy <murp@ibm.com>
Tue, 16 May 2023 19:16:51 +0000 (19:16 +0000)
commit4cf79e479bbf334f2a5d248852b83c169a11c727
tree90cd96fc0fe47a038006044ead7ce16fea9a41f7
parent6042a062dc2556a0a1c06d3b85b6c080644da04e
cmd/link/internal/ppc64: link ELFv2 objects built with -mcpu=power10

Specifically, objects built via cgo using CGO_CFLAGS="-O2 -g -mcpu=power10".

These use new relocations defined by ELFv2 1.5, and the R_PPC64_REL24_NOTOC
relocation. These objects contain functions which may not use a TOC
pointer requiring the insertion of trampolines to use correctly.

The relocation targets of these ELFv2 objects may also contain non-zero
values. Clear the relocated bits before setting them.

Extra care is taken if GOPPC64 < power10. The R_PPC64_REL24_NOTOC reloc
existed prior to ELFv2 1.5. The presence of this relocation itself does
not imply a power10 target. Generate power8 compatible stubs if
GOPPC64 < power10.

Updates #44549

Change-Id: I06ff8c4e47ed9af835a7dcfbafcfa4c538f75544
Reviewed-on: https://go-review.googlesource.com/c/go/+/492617
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/link/internal/ppc64/asm.go