diff options
author | Austin Clements <austin@google.com> | 2016-11-28 14:54:38 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-11-29 15:27:49 +0000 |
commit | d39b7b5347a3e6cc9173224393e4cfaf874a272a (patch) | |
tree | b13759f204d5090ac25c677b81caba44d0540bea /src/runtime/os_linux.go | |
parent | 5d1c60118deb4f7839f56f87ec101401f370192c (diff) | |
download | go-d39b7b5347a3e6cc9173224393e4cfaf874a272a.tar.gz go-d39b7b5347a3e6cc9173224393e4cfaf874a272a.zip |
runtime: extract Linux auxv handling
This refactoring is in preparation for handling auxv differently in
Android shared libraries.
Updates #18041.
Change-Id: If0458a309f9c804e7abd0a58b5a224d89f8da257
Reviewed-on: https://go-review.googlesource.com/33651
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/os_linux.go')
-rw-r--r-- | src/runtime/os_linux.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go index 72d17f549a..67c62bc18e 100644 --- a/src/runtime/os_linux.go +++ b/src/runtime/os_linux.go @@ -200,6 +200,10 @@ func sysargs(argc int32, argv **byte) { // now argv+n is auxv auxv := (*[1 << 28]uintptr)(add(unsafe.Pointer(argv), uintptr(n)*sys.PtrSize)) + sysauxv(auxv[:]) +} + +func sysauxv(auxv []uintptr) { for i := 0; auxv[i] != _AT_NULL; i += 2 { tag, val := auxv[i], auxv[i+1] switch tag { |