mirror of
https://github.com/golang/go
synced 2024-10-03 03:11:21 -06:00
dfc8649854
Android linker does not handle TLS for us. We set up the TLS slot for g, as darwin/386,amd64 handle instead. This is disgusting and fragile. We will eventually fix this ugly hack by taking advantage of the recent TLS IE model implementation. (Instead of referencing an GOT entry, make the code sequence look into the TLS variable that holds the offset.) The TLS slot for g in android/amd64 assumes a fixed offset from %fs. See runtime/cgo/gcc_android_amd64.c for details. For golang/go#10743 Change-Id: I1a3fc207946c665515f79026a56ea19134ede2dd Reviewed-on: https://go-review.googlesource.com/15991 Reviewed-by: David Crawshaw <crawshaw@golang.org>
34 lines
1.0 KiB
ArmAsm
34 lines
1.0 KiB
ArmAsm
// Copyright 2015 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
#include "textflag.h"
|
|
|
|
TEXT _rt0_amd64_android(SB),NOSPLIT,$-8
|
|
MOVQ 0(SP), DI // argc
|
|
LEAQ 8(SP), SI // argv
|
|
MOVQ $main(SB), AX
|
|
JMP AX
|
|
|
|
TEXT _rt0_amd64_android_lib(SB),NOSPLIT,$0
|
|
MOVQ $1, DI // argc
|
|
MOVQ $_rt0_amd64_android_argv(SB), SI // argv
|
|
MOVQ $_rt0_amd64_linux_lib(SB), AX
|
|
JMP AX
|
|
|
|
DATA _rt0_amd64_android_argv+0x00(SB)/8,$_rt0_amd64_android_argv0(SB)
|
|
DATA _rt0_amd64_android_argv+0x08(SB)/8,$0
|
|
DATA _rt0_amd64_android_argv+0x10(SB)/8,$0
|
|
DATA _rt0_amd64_android_argv+0x18(SB)/8,$15 // AT_PLATFORM
|
|
DATA _rt0_amd64_android_argv+0x20(SB)/8,$_rt0_amd64_android_auxv0(SB)
|
|
DATA _rt0_amd64_android_argv+0x28(SB)/8,$0
|
|
GLOBL _rt0_amd64_android_argv(SB),NOPTR,$0x30
|
|
|
|
// TODO: AT_HWCAP necessary? If so, what value?
|
|
|
|
DATA _rt0_amd64_android_argv0(SB)/8, $"gojni"
|
|
GLOBL _rt0_amd64_android_argv0(SB),RODATA,$8
|
|
|
|
DATA _rt0_amd64_android_auxv0(SB)/8, $"x86_64"
|
|
GLOBL _rt0_amd64_android_auxv0(SB),RODATA,$8
|