cmd/internal/ld, runtime: halve tlsoffset on ELF/intel

For OSes that use elf on intel, 2*Ptrsize bytes are reserved for TLS.
But only one pointer (g) has been stored in the TLS for a while now.
So we can set it to just Ptrsize, which happily matches what happens
when externally linking.

Fixes #9913

Change-Id: Ic816369d3a55a8cdcc23be349b1a1791d53f5f81
Reviewed-on: https://go-review.googlesource.com/6584
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Michael Hudson-Doyle 2015-03-04 16:28:45 +13:00 committed by Ian Lance Taylor
parent 5e49bfec92
commit 658a338f78
12 changed files with 20 additions and 20 deletions

View file

@ -170,7 +170,7 @@ func Linknew(arch *LinkArch) *Link {
Hopenbsd,
Hdragonfly,
Hsolaris:
ctxt.Tlsoffset = -2 * ctxt.Arch.Ptrsize
ctxt.Tlsoffset = -1 * ctxt.Arch.Ptrsize
case Hnacl:
switch ctxt.Arch.Thechar {