Blame SOURCES/cmd-link-use-correct-path-for-dynamic-loader-on-ppc6.patch

aae78f
From 241192ecd31ca03a6f68fa7e55bb9f66040d3a2f Mon Sep 17 00:00:00 2001
aae78f
From: Lynn Boger <laboger@linux.vnet.ibm.com>
aae78f
Date: Thu, 14 Jul 2022 10:47:28 -0500
aae78f
Subject: [PATCH] cmd/link: use correct path for dynamic loader on ppc64le
aae78f
aae78f
The setting of the path for the dynamic loader when building for
aae78f
linux/ppc64le ELF v2 was incorrectly set to the path for
aae78f
PPC64 ELF v1. This has not caused issues in the common cases
aae78f
because this string can be set based on the default GO_LDSO setting.
aae78f
It does result in an incorrect value when cross compiling binaries
aae78f
with -buildmode=pie.
aae78f
aae78f
Updates #53813
aae78f
aae78f
Change-Id: I84de1c97b42e0434760b76a57c5a05e055fbb730
aae78f
---
aae78f
 src/cmd/link/internal/ppc64/obj.go | 13 +++++++------
aae78f
 1 file changed, 7 insertions(+), 6 deletions(-)
aae78f
aae78f
diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go
aae78f
index b6d5ad92af..bca8fa9212 100644
aae78f
--- a/src/cmd/link/internal/ppc64/obj.go
aae78f
+++ b/src/cmd/link/internal/ppc64/obj.go
aae78f
@@ -38,9 +38,12 @@ import (
aae78f
 )
aae78f
 
aae78f
 func Init() (*sys.Arch, ld.Arch) {
aae78f
-	arch := sys.ArchPPC64
aae78f
-	if buildcfg.GOARCH == "ppc64le" {
aae78f
-		arch = sys.ArchPPC64LE
aae78f
+	arch := sys.ArchPPC64LE
aae78f
+	dynld := "/lib64/ld64.so.2"
aae78f
+
aae78f
+	if buildcfg.GOARCH == "ppc64" {
aae78f
+		arch = sys.ArchPPC64
aae78f
+		dynld = "/lib64/ld64.so.1"
aae78f
 	}
aae78f
 
aae78f
 	theArch := ld.Arch{
aae78f
@@ -64,9 +67,7 @@ func Init() (*sys.Arch, ld.Arch) {
aae78f
 		Machoreloc1:      machoreloc1,
aae78f
 		Xcoffreloc1:      xcoffreloc1,
aae78f
 
aae78f
-		// TODO(austin): ABI v1 uses /usr/lib/ld.so.1,
aae78f
-		Linuxdynld: "/lib64/ld64.so.1",
aae78f
-
aae78f
+		Linuxdynld:     dynld,
aae78f
 		Freebsddynld:   "XXX",
aae78f
 		Openbsddynld:   "XXX",
aae78f
 		Netbsddynld:    "XXX",
aae78f
-- 
aae78f
2.35.3
aae78f