]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: extract Linux auxv handling
authorAustin Clements <austin@google.com>
Mon, 28 Nov 2016 19:54:38 +0000 (14:54 -0500)
committerAustin Clements <austin@google.com>
Tue, 29 Nov 2016 15:27:49 +0000 (15:27 +0000)
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>
src/runtime/os_linux.go

index 72d17f549a4707e676e7c08bac33b55129f093ac..67c62bc18e6e9eea9b80172979ce24fcc235c5aa 100644 (file)
@@ -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 {