]> Cypherpunks repositories - gostls13.git/commit
runtime: fall back to /proc/self/auxv in Android libs
authorAustin Clements <austin@google.com>
Mon, 28 Nov 2016 23:03:16 +0000 (18:03 -0500)
committerAustin Clements <austin@google.com>
Tue, 29 Nov 2016 15:27:53 +0000 (15:27 +0000)
commit6f287fa2bb5b0b74506ecc586d036dcd11a761e2
tree696350e756d42d210b017dec100feb976257a4eb
parentd39b7b5347a3e6cc9173224393e4cfaf874a272a
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>
src/runtime/os_linux.go
src/runtime/rt0_android_amd64.s
src/runtime/rt0_android_arm.s
src/runtime/rt0_android_arm64.s