Skip to content

Commit

Permalink
runtime: make sure R0 is zero before _main on ppc64le
Browse files Browse the repository at this point in the history
_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>
  • Loading branch information
ceseo authored and laboger committed Aug 11, 2017
1 parent 98031d8 commit 9aea0e8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime/rt0_linux_ppc64le.s
Expand Up @@ -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
Expand Down

0 comments on commit 9aea0e8

Please sign in to comment.