]> Cypherpunks repositories - gostls13.git/commit
runtime: fix GOARM<7 build
authorDave Cheney <dave@cheney.net>
Fri, 19 Sep 2014 02:02:21 +0000 (02:02 +0000)
committerDave Cheney <dave@cheney.net>
Fri, 19 Sep 2014 02:02:21 +0000 (02:02 +0000)
commit66795e8ba101fc20916196db6d343b0d927e7dd5
tree803a4a08bce09577c31e0c0cf27327116df8847f
parent54b63f06478d390d69fc826a16ab19dc6b5d5503
runtime: fix GOARM<7 build

Update #8690

If liblink determines that the host doesn't support TLS it replaces the MRC call with a BL runtime.tls_read_fallback. The problem is save_g doesn't expect anyone to make any BL calls and hasn't setup its own link register properly so when runtime.tls_read_fallback returns the LR points to save_g, not save_g's caller so the RET at the end of the function turns into an infinite loop.

This fix is only a proof of concept, I think the real fix should go into liblink as its MRC substitution is not as transparent as expected.

LGTM=rsc
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/143050043
src/runtime/tls_arm.s