]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: make sure R0 is zero before _main on ppc64le
authorCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Thu, 10 Aug 2017 17:48:36 +0000 (14:48 -0300)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Fri, 11 Aug 2017 17:46:24 +0000 (17:46 +0000)
_main has an early check to verify if a binary is statically or dynamically
linked that depends on R0 being zero. R0 is not guaranteed to be zero at that
point and this was breaking Go on Alpine for ppc64le.

Change-Id: I4a1059ff7fd3db6fc489e7dcfe631c1814dd965b
Reviewed-on: https://go-review.googlesource.com/54730
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
src/runtime/rt0_linux_ppc64le.s

index 134858bff88f1835e1cb5382c5112ea19a5a288e..73b9ae392d2b48050ce5dd76df70af8e3bb1f5a4 100644 (file)
@@ -2,6 +2,7 @@
 #include "textflag.h"
 
 TEXT _rt0_ppc64le_linux(SB),NOSPLIT,$0
+       XOR R0, R0        // Make sure R0 is zero before _main
        BR _main<>(SB)
 
 TEXT _rt0_ppc64le_linux_lib(SB),NOSPLIT,$-8