cmd/link: use /lib/ld64.so.1 as dynamic linker path for s390x

On s390x systems the standard location of the dynamic linker is
/lib/ld64.so.1. However, the linker was emitting /lib64/ld64.so.1
as the ELF interpreter for PIE binaries.

Many s390x environments only provide the dynamic linker at
/lib/ld64.so.1, and the /lib64 path may not exist. As a result,
PIE binaries built with Go fail to execute because the kernel
cannot locate the interpreter.

Update the s390x linker configuration to use /lib/ld64.so.1 as
the default dynamic linker path.

Fixes #78171

Change-Id: I956a705a8c78e6686122e29e7c920335cbedbcdb
Reviewed-on: https://go-review.googlesource.com/c/go/+/755460
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Kiran M Vijay IBM <kiran.m.vijay@ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Srinivas Pokala 2026-03-16 08:06:49 +01:00 committed by Cherry Mui
parent 043b76a90d
commit 81973b4038

View file

@ -55,7 +55,7 @@ func Init() (*sys.Arch, ld.Arch) {
TLSIEtoLE: tlsIEtoLE,
ELF: ld.ELFArch{
Linuxdynld: "/lib64/ld64.so.1",
Linuxdynld: "/lib/ld64.so.1",
LinuxdynldMusl: "/lib/ld-musl-s390x.so.1",
// not relevant for s390x