diff options
| author | Michael Hudson-Doyle <michael.hudson@canonical.com> | 2015-09-02 11:23:15 +1200 |
|---|---|---|
| committer | Michael Hudson-Doyle <michael.hudson@canonical.com> | 2015-10-08 00:21:30 +0000 |
| commit | a5cb76243af54a6729f5668317fb87baa242b9cc (patch) | |
| tree | 17fec3b0ed013e7d1ed2865c89195d0ade9c6cfd /src/cmd/internal/obj/arm | |
| parent | 1ef9b5a5b90e6ea4dd5d9495cfe0d3d24446ff22 (diff) | |
| download | go-a5cb76243af54a6729f5668317fb87baa242b9cc.tar.xz | |
cmd/internal/obj, cmd/link, runtime: lots of TLS cleanup
It's particularly nice to get rid of the android special cases in the linker.
Change-Id: I516363af7ce8a6b2f196fe49cb8887ac787a6dad
Reviewed-on: https://go-review.googlesource.com/14197
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/arm')
| -rw-r--r-- | src/cmd/internal/obj/arm/asm5.go | 17 | ||||
| -rw-r--r-- | src/cmd/internal/obj/arm/obj5.go | 18 |
2 files changed, 1 insertions, 34 deletions
diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go index c240e89d46..3bf4a31729 100644 --- a/src/cmd/internal/obj/arm/asm5.go +++ b/src/cmd/internal/obj/arm/asm5.go @@ -739,9 +739,6 @@ func span5(ctxt *obj.Link, cursym *obj.LSym) { * code references to be relocated too, and then * perhaps we'd be able to parallelize the span loop above. */ - if ctxt.Tlsg == nil { - ctxt.Tlsg = obj.Linklookup(ctxt, "runtime.tlsg", 0) - } p = cursym.Text ctxt.Autosize = int32(p.To.Offset + 4) @@ -1646,19 +1643,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { rel.Sym = p.To.Sym rel.Add = p.To.Offset - // runtime.tlsg is special. - // Its "address" is the offset from the TLS thread pointer - // to the thread-local g and m pointers. - // Emit a TLS relocation instead of a standard one if its - // type is not explicitly set by runtime. This assumes that - // all references to runtime.tlsg should be accompanied with - // its type declaration if necessary. - if rel.Sym == ctxt.Tlsg && ctxt.Tlsg.Type == 0 { - rel.Type = obj.R_TLS - if ctxt.Flag_shared != 0 { - rel.Add += ctxt.Pc - p.Rel.Pc - 8 - int64(rel.Siz) - } - } else if ctxt.Flag_shared != 0 { + if ctxt.Flag_shared != 0 { rel.Type = obj.R_PCREL rel.Add += ctxt.Pc - p.Rel.Pc - 8 } else { diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go index d9f587b087..00ab13ccc3 100644 --- a/src/cmd/internal/obj/arm/obj5.go +++ b/src/cmd/internal/obj/arm/obj5.go @@ -129,24 +129,6 @@ func progedit(ctxt *obj.Link, p *obj.Prog) { p.From.Offset = 0 } } - - if ctxt.Flag_shared != 0 { - // Shared libraries use R_ARM_TLS_IE32 instead of - // R_ARM_TLS_LE32, replacing the link time constant TLS offset in - // runtime.tlsg with an address to a GOT entry containing the - // offset. Rewrite $runtime.tlsg(SB) to runtime.tlsg(SB) to - // compensate. - if ctxt.Tlsg == nil { - ctxt.Tlsg = obj.Linklookup(ctxt, "runtime.tlsg", 0) - } - - if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && p.From.Sym == ctxt.Tlsg { - p.From.Type = obj.TYPE_MEM - } - if p.To.Type == obj.TYPE_ADDR && p.To.Name == obj.NAME_EXTERN && p.To.Sym == ctxt.Tlsg { - p.To.Type = obj.TYPE_MEM - } - } } // Prog.mark |
