From fa16efb8358e0cb23e285803075764abbdcffe5e Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Wed, 14 Jul 2021 14:09:27 -0500 Subject: cmd/link: enable internal linking of PIE binaries on ppc64le The amd64/arm64 relocation processing is used as a template and updated for ppc64le. This requires updating the TOC relocation handling code to support linux type TOC relocations too (note, AIX uses TOC-indirect accesses). Noteably, the shared flag of go functions is used as a proxy for the local entry point offset encoded in elf objects. Functions in go ppc64le shared objects always[1] insert 2 instructions to regenerate the TOC pointer. [1] excepting a couple special runtime functions, see preprocess in obj9.go for specific details of this behavior. Change-Id: I3646e6dc8a0a0ffe712771a976983315eae5c418 Reviewed-on: https://go-review.googlesource.com/c/go/+/352829 Run-TryBot: Paul Murphy Reviewed-by: Cherry Mui TryBot-Result: Go Bot Trust: Lynn Boger --- src/cmd/dist/test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/dist') diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 14b48351db..98e30a158f 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -1013,7 +1013,7 @@ func (t *tester) internalLink() bool { func (t *tester) internalLinkPIE() bool { switch goos + "-" + goarch { case "darwin-amd64", "darwin-arm64", - "linux-amd64", "linux-arm64", + "linux-amd64", "linux-arm64", "linux-ppc64le", "android-arm64", "windows-amd64", "windows-386", "windows-arm": return true -- cgit v1.3-5-g9baa