Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(215)

Issue 143050043: code review 143050043: runtime: fix GOARM<7 build (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by dave
Modified:
11 years ago
Reviewers:
rsc
CC:
rsc, minux, golang-codereviews
Visibility:
Public.

Description

runtime: fix GOARM<7 build Update issue 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.

Patch Set 1 #

Patch Set 2 : diff -r b2eb00e46b33b62701a225c329d82181b084baca https://code.google.com/p/go #

Patch Set 3 : diff -r b2eb00e46b33b62701a225c329d82181b084baca https://code.google.com/p/go #

Patch Set 4 : diff -r 6b163ec2122a172030284060788f535ab3b9d0e3 https://code.google.com/p/go #

Patch Set 5 : diff -r efbf09e0a5b49cb07d32be24d2291dc28bbf5d69 https://code.google.com/p/go #

Patch Set 6 : diff -r e76e4cdfa016710fc576e3418a2ff64d93753f5b https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -0 lines) Patch
M src/runtime/tls_arm.s View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 10
dave_cheney.net
Hello rsc@golang.org, minux@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years ago (2014-09-15 03:01:46 UTC) #1
dave_cheney.net
On 2014/09/15 03:01:46, dfc wrote: > Hello mailto:rsc@golang.org, mailto:minux@golang.org (cc: > mailto:golang-codereviews@googlegroups.com), > > I'd ...
11 years ago (2014-09-16 15:12:31 UTC) #2
minux
could we assume that the kernel's tls helper only clobber r0 and r11?
11 years ago (2014-09-16 16:46:33 UTC) #3
dave_cheney.net
From memory the kernel helper only clobbers R0. Would you prefer me to use R11 ...
11 years ago (2014-09-17 02:16:56 UTC) #4
rsc
if you are going to clobber R12 here please document that setg<> now does that, ...
11 years ago (2014-09-18 19:04:27 UTC) #5
dave_cheney.net
Would you like me to use R11 instead ? On 19 Sep 2014 05:04, <rsc@golang.org> ...
11 years ago (2014-09-18 19:06:59 UTC) #6
dave_cheney.net
Hello rsc@golang.org, minux@golang.org (cc: golang-codereviews@googlegroups.com), Please take another look.
11 years ago (2014-09-19 01:30:14 UTC) #7
dave_cheney.net
On 2014/09/18 19:04:27, rsc wrote: > if you are going to clobber R12 here please ...
11 years ago (2014-09-19 01:30:47 UTC) #8
rsc
LGTM
11 years ago (2014-09-19 01:50:09 UTC) #9
dave_cheney.net
11 years ago (2014-09-19 02:02:39 UTC) #10
*** Submitted as https://code.google.com/p/go/source/detail?r=cb017773523e ***

runtime: fix GOARM<7 build

Update issue 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://codereview.appspot.com/143050043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b