From: Michael Hudson-Doyle Date: Thu, 23 Apr 2015 08:04:14 +0000 (+1200) Subject: cmd/internal/ld: fix R_TLS handling now Xsym is not read from object file X-Git-Tag: go1.5beta1~917 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ccc76dba606e2325ad82ac0b15fb5c511a342abd;p=gostls13.git cmd/internal/ld: fix R_TLS handling now Xsym is not read from object file I think this should fix the arm build. A proper fix involves making the handling of tlsg less fragile, I'll try that tomorrow. Update #10557 Change-Id: I9b1b666737fb40aebb6f284748509afa8483cce5 Reviewed-on: https://go-review.googlesource.com/9272 Reviewed-by: Dave Cheney Run-TryBot: Dave Cheney --- diff --git a/src/cmd/internal/ld/data.go b/src/cmd/internal/ld/data.go index 13a4019888..5a0ac9e7df 100644 --- a/src/cmd/internal/ld/data.go +++ b/src/cmd/internal/ld/data.go @@ -372,6 +372,14 @@ func relocsym(s *LSym) { } case obj.R_TLS: + if Linkmode == LinkExternal && Iself && HEADTYPE != obj.Hopenbsd { + r.Done = 0 + r.Sym = Ctxt.Tlsg + r.Xsym = Ctxt.Tlsg + r.Xadd = r.Add + o = r.Add + break + } if Linkmode == LinkInternal && Iself && Thearch.Thechar == '5' { // On ELF ARM, the thread pointer is 8 bytes before // the start of the thread-local data block, so add 8