Article View: linux.debian.bugs.rc
Article #938Bug#1151166: reassigning to golang-golang-x-sys
From: Juan Manuel Méndez Rey
Date: Sun, 18 Oct 2026 23:10
Date: Sun, 18 Oct 2026 23:10
51 lines
3965 bytes
3965 bytes
Control: reassign 1151166 golang-golang-x-sys 0.49.0+dfsg-1
Control: retitle 1151166 golang-golang-x-sys: ppc64x syscall trampolines omit the ELFv2 R12 setup, so PIE binaries die at startup
Control: tags 1151166 + patch
Reassigning. This is not golang-1.27.
I filed it against golang-1.27 because siso built on ppc64el under 1.26 and
failed under 1.27. Two things had changed at once. Holding the toolchain fixed
and varying only x/sys, three runs each:
go1.27.2 + x/sys 0.48.0, -buildmode=pie, ppc64le ok 3/3
go1.27.2 + x/sys 0.49.0, -buildmode=pie, ppc64le crash 3/3
go1.26.9 + x/sys 0.49.0, -buildmode=pie, ppc64le crash 3/3
Both toolchains fail with 0.49.0, so only the x/sys version matters.
The cause is in unix/asm_linux_ppc64x.s. The Syscall, Syscall6, RawSyscall and
RawSyscall6 trampolines branch to the global entry point of the generated
syscall ABI0 wrapper without setting R12:
TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVD $syscall·Syscall(SB), R31
MOVD R31, CTR
JMP (CTR)
In a PIE binary that wrapper derives its TOC from R12, as ELFv2 requires of a
caller that enters through the global entry point. R12 is stale, so the TOC is
displaced and every global access afterwards is wrong. Non-PIE wrappers have no
such prologue, which is why only PIE fails.
One instruction per trampoline fixes it, MOVD R31, R12 after the address load.
The trampolines came back in upstream b6b8557 (2026-10-05), which reverts
7155702 (2018, Fixes golang/go#16662). That commit had removed them on purpose,
because the ppc64x external linker cannot always handle the direct branch when
the offset is too far. Not forwarded upstream yet.
The patch and the measurements are in this merge request:
https://salsa.debian.org/go-team/packages/golang-golang-x-sys/-/merge_requests/6
ppc64 big-endian is not tested. The file serves both and I only ran ppc64le.
Technical Details
Message-ID:
<NPIaS-6q6t-7@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<NPfLz-6avR-1@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Juan Manuel Méndez Rey <juan.mendezr@proton.me> Newsgroups: linux.debian.bugs.rc Subject: Bug#1151166: reassigning to golang-golang-x-sys Date: Mon, 19 Oct 2026 01:10:02 +0200 Message-ID: <NPIaS-6q6t-7@gated-at.bofh.it> References: <NPfLz-6avR-1@gated-at.bofh.it> X-Mailbox-Line: From debian-bugs-rc-request@lists.debian.org Sun Oct 18 23:05:09 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.451 Reply-To: Juan Manuel Méndez Rey <juan.mendezr@proton.me>, 1151166@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: team+go-compiler@tracker.debian.org X-Debian-Pr-Message: followup 1151166 X-Debian-Pr-Package: src:golang-1.27 X-Debian-Pr-Keywords: ftbfs X-Debian-Pr-Source: golang-1.27 Feedback-ID: 176548819:user:proton X-Pm-Message-ID: 6df808958491a9df00438cf4d5f6930e0472ac96 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Greylist: delayed 402 seconds by postgrey-1.37 at buxtehude; Sun, 18 Oct 2026 23:02:33 UTC X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-rc@lists.debian.org> archive/latest/834976 List-ID: <debian-bugs-rc.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-rc/> Approved: robomod@news.nic.it Lines: 51 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sun, 18 Oct 2026 22:55:36 +0000 X-Original-Message-ID: <6b97fd80de7cf5da6d9dc3edd3550355@proton.me> X-Original-References: <5FGs0fjLxqtGOak9bZLmUYMIQiiz7zHlVHNYvGRseidYWFsUyHfEqVKBN4PhP-19DsSxwxevyXScVHUUJ9loNNN-wzEGdS144LpH5Iot9GE=@proton.me>