diff options
author | Austin Clements <austin@google.com> | 2016-11-28 18:03:16 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-11-29 15:27:53 +0000 |
commit | 6f287fa2bb5b0b74506ecc586d036dcd11a761e2 (patch) | |
tree | 696350e756d42d210b017dec100feb976257a4eb /src/runtime/rt0_android_amd64.s | |
parent | d39b7b5347a3e6cc9173224393e4cfaf874a272a (diff) | |
download | go-git-6f287fa2bb5b0b74506ecc586d036dcd11a761e2.tar.gz |
runtime: fall back to /proc/self/auxv in Android libs
Android's libc doesn't provide access to auxv, so currently the Go
runtime synthesizes a fake, minimal auxv when loaded as a library on
Android. This used to be sufficient, but now we depend on auxv to
retrieve the system physical page size and panic if we can't retrieve
it.
Fix this by falling back to reading auxv from /proc/self/auxv if the
loader-provided auxv is empty and removing the synthetic auxv vectors.
Fixes #18041.
Change-Id: Ia2ec2c764a6609331494a5d359032c56cbb83482
Reviewed-on: https://go-review.googlesource.com/33652
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/runtime/rt0_android_amd64.s')
-rw-r--r-- | src/runtime/rt0_android_amd64.s | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/runtime/rt0_android_amd64.s b/src/runtime/rt0_android_amd64.s index 9af6cab16f..6420c9f35d 100644 --- a/src/runtime/rt0_android_amd64.s +++ b/src/runtime/rt0_android_amd64.s @@ -17,17 +17,10 @@ TEXT _rt0_amd64_android_lib(SB),NOSPLIT,$0 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_argv+0x08(SB)/8,$0 // end argv +DATA _rt0_amd64_android_argv+0x10(SB)/8,$0 // end envv +DATA _rt0_amd64_android_argv+0x18(SB)/8,$0 // end auxv +GLOBL _rt0_amd64_android_argv(SB),NOPTR,$0x20 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 |