aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/rt0_linux_ppc64le.s
diff options
context:
space:
mode:
authorCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>2017-08-10 14:48:36 -0300
committerLynn Boger <laboger@linux.vnet.ibm.com>2017-08-11 17:46:24 +0000
commit9aea0e89b6df032c29d0add8d69ba2c95f1106d9 (patch)
treefd4743c1ab78582c7c686e575d9278bdc72dacf4 /src/runtime/rt0_linux_ppc64le.s
parent98031d8cd0b8cfc731a9aaca058b1dd590e4ad86 (diff)
downloadgo-9aea0e89b6df032c29d0add8d69ba2c95f1106d9.tar.gz
go-9aea0e89b6df032c29d0add8d69ba2c95f1106d9.zip
runtime: make sure R0 is zero before _main on ppc64le
_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>
Diffstat (limited to 'src/runtime/rt0_linux_ppc64le.s')
-rw-r--r--src/runtime/rt0_linux_ppc64le.s1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/rt0_linux_ppc64le.s b/src/runtime/rt0_linux_ppc64le.s
index 134858bff8..73b9ae392d 100644
--- a/src/runtime/rt0_linux_ppc64le.s
+++ b/src/runtime/rt0_linux_ppc64le.s
@@ -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