From 6f287fa2bb5b0b74506ecc586d036dcd11a761e2 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 28 Nov 2016 18:03:16 -0500 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: David Crawshaw --- src/runtime/rt0_android_arm.s | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/runtime/rt0_android_arm.s') diff --git a/src/runtime/rt0_android_arm.s b/src/runtime/rt0_android_arm.s index 85712531d2..189e290e35 100644 --- a/src/runtime/rt0_android_arm.s +++ b/src/runtime/rt0_android_arm.s @@ -19,17 +19,10 @@ TEXT _rt0_arm_android_lib(SB),NOSPLIT,$0 RET DATA _rt0_arm_android_argv+0x00(SB)/4,$_rt0_arm_android_argv0(SB) -DATA _rt0_arm_android_argv+0x04(SB)/4,$0 -DATA _rt0_arm_android_argv+0x08(SB)/4,$0 -DATA _rt0_arm_android_argv+0x0C(SB)/4,$15 // AT_PLATFORM -DATA _rt0_arm_android_argv+0x10(SB)/4,$_rt0_arm_android_auxv0(SB) -DATA _rt0_arm_android_argv+0x14(SB)/4,$16 // AT_HWCAP -DATA _rt0_arm_android_argv+0x18(SB)/4,$0x2040 // HWCAP_VFP | HWCAP_VFPv3 -DATA _rt0_arm_android_argv+0x1C(SB)/4,$0 -GLOBL _rt0_arm_android_argv(SB),NOPTR,$0x20 +DATA _rt0_arm_android_argv+0x04(SB)/4,$0 // end argv +DATA _rt0_arm_android_argv+0x08(SB)/4,$0 // end envv +DATA _rt0_arm_android_argv+0x0c(SB)/4,$0 // end auxv +GLOBL _rt0_arm_android_argv(SB),NOPTR,$0x10 DATA _rt0_arm_android_argv0(SB)/8, $"gojni" GLOBL _rt0_arm_android_argv0(SB),RODATA,$8 - -DATA _rt0_arm_android_auxv0(SB)/4, $"v7l" -GLOBL _rt0_arm_android_auxv0(SB),RODATA,$4 -- cgit v1.3-5-g9baa