diff options
| author | Michael Hudson-Doyle <michael.hudson@canonical.com> | 2015-03-04 16:28:45 +1300 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2015-03-05 01:23:29 +0000 |
| commit | 658a338f78ef5dce4c81527c34fb52be95357ef7 (patch) | |
| tree | 76c9bd732f7933488f6ed0a775b0ecb252469f6a /src/runtime/sys_linux_386.s | |
| parent | 5e49bfec92e04ca9eda715c8d61690ba5b47b9bf (diff) | |
| download | go-658a338f78ef5dce4c81527c34fb52be95357ef7.tar.xz | |
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>
Diffstat (limited to 'src/runtime/sys_linux_386.s')
| -rw-r--r-- | src/runtime/sys_linux_386.s | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s index 7d53aad59a..d4bd142134 100644 --- a/src/runtime/sys_linux_386.s +++ b/src/runtime/sys_linux_386.s @@ -410,16 +410,16 @@ TEXT runtime·setldt(SB),NOSPLIT,$32 * When linking against the system libraries, * we use its pthread_create and let it set up %gs * for us. When we do that, the private storage - * we get is not at 0(GS), 4(GS), but -8(GS), -4(GS). + * we get is not at 0(GS), but -4(GS). * To insulate the rest of the tool chain from this - * ugliness, 8l rewrites 0(TLS) into -8(GS) for us. + * ugliness, 8l rewrites 0(TLS) into -4(GS) for us. * To accommodate that rewrite, we translate * the address here and bump the limit to 0xffffffff (no limit) - * so that -8(GS) maps to 0(address). - * Also, the final 0(GS) (current 8(CX)) has to point + * so that -4(GS) maps to 0(address). + * Also, the final 0(GS) (current 4(CX)) has to point * to itself, to mimic ELF. */ - ADDL $0x8, CX // address + ADDL $0x4, CX // address MOVL CX, 0(CX) // set up user_desc |
